<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Fumble節(jié)點(diǎn)錯(cuò)誤對象

          聯(lián)合創(chuàng)作 · 2023-09-20 10:19

          Fumble 是簡單的節(jié)點(diǎn)里的錯(cuò)誤對象。專門為 fetchr 庫創(chuàng)建,基于 hapi.js。

          示例代碼:

          var fumble = require('fumble');
          var callAndProcess = require('./callAndProcess');
          module.exports = require('api').base.service({
              name: 'foo',    
              read: function (req, resource, params, context, callback) {        
              switch(resource) {            
                  case this.name: 
                          callAndProcess(req, params, context, callback);                
                          return;
                  }        
          var error = fumble.http.create(400, 'Passed in an invalid resource', {
                      debug: [resource]
                  });
          
                  req.error(error);
                  req.debug(error.stack); 
                  // nice stack trace
                  /**        
                  * logs:        
                  * { [HttpError: Bad Request] statusCode: 400, message:         
                  * 'Passed in an invalid resource', debug: [ resource ] }        
                  */
                  callback(error);
              }
          });

           

          瀏覽 16
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  操婊网| 伊人免费视频 | 伊人国产在线 | 乱系列视频在线观看 | 婷婷综合久久五月 |