pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='Csohe'></bdo><ul id='Csohe'></ul>

        <small id='Csohe'></small><noframes id='Csohe'>

        <i id='Csohe'><tr id='Csohe'><dt id='Csohe'><q id='Csohe'><span id='Csohe'><b id='Csohe'><form id='Csohe'><ins id='Csohe'></ins><ul id='Csohe'></ul><sub id='Csohe'></sub></form><legend id='Csohe'></legend><bdo id='Csohe'><pre id='Csohe'><center id='Csohe'></center></pre></bdo></b><th id='Csohe'></th></span></q></dt></tr></i><div class="eaookys" id='Csohe'><tfoot id='Csohe'></tfoot><dl id='Csohe'><fieldset id='Csohe'></fieldset></dl></div>
      1. <tfoot id='Csohe'></tfoot><legend id='Csohe'><style id='Csohe'><dir id='Csohe'><q id='Csohe'></q></dir></style></legend>
      2. 在 gulp 任務中很好地拋出錯誤

        Nicely throwing an error in gulp task(在 gulp 任務中很好地拋出錯誤)

            <small id='Sqyxc'></small><noframes id='Sqyxc'>

            • <tfoot id='Sqyxc'></tfoot>
                <tbody id='Sqyxc'></tbody>
              <i id='Sqyxc'><tr id='Sqyxc'><dt id='Sqyxc'><q id='Sqyxc'><span id='Sqyxc'><b id='Sqyxc'><form id='Sqyxc'><ins id='Sqyxc'></ins><ul id='Sqyxc'></ul><sub id='Sqyxc'></sub></form><legend id='Sqyxc'></legend><bdo id='Sqyxc'><pre id='Sqyxc'><center id='Sqyxc'></center></pre></bdo></b><th id='Sqyxc'></th></span></q></dt></tr></i><div class="gqcmw2w" id='Sqyxc'><tfoot id='Sqyxc'></tfoot><dl id='Sqyxc'><fieldset id='Sqyxc'></fieldset></dl></div>
                <bdo id='Sqyxc'></bdo><ul id='Sqyxc'></ul>

                  <legend id='Sqyxc'><style id='Sqyxc'><dir id='Sqyxc'><q id='Sqyxc'></q></dir></style></legend>
                1. 本文介紹了在 gulp 任務中很好地拋出錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在創建一個在某些情況下可能會失敗的 gulp 任務.

                  gulp.task('favicon', function () {嘗試 {require('child_process').execSync('icotool --version');} 捕捉( e ) {var err = new Error('生成 favicon 需要 Unix bash 和 icotool');拋出錯誤;}返回 gulp.src('', {read: false}).管道(外殼(['./generate-favicon.sh']));});

                  當通過 gulp 運行我的任務并遇到錯誤時,該錯誤將呈現得相當難看.我想以一種方式呈現錯誤,例如,jslint gulp-util 的 PluginError.

                  它實際上只是在其中創建一個 PluginError 并拋出它,但這似乎不太正確.另一個不太好的解決方案是設置

                  err.showStack = false;

                  至少有更好的錯誤輸出.gulp.task.Error 會很好.

                  解決方案

                  據我所知,從 gulp 中拋出錯誤并不是很好.但是我發現了這個我曾經為我工作的博客條目.

                  http://gotofritz.net/博客/geekery/how-to-generate-error-in-gulp-task/

                  編輯:gulp-util已棄用.相反,請使用 plugin-error 包.p>

                  我的例子:

                  var gulp = require('gulp');var error = require('plugin-error');gulp.task('部署',函數(cb){if(typeof(specialId) === '未定義') {var err = new PluginError({插件:'部署',消息:'specialId 為空.'});}}

                  I am creating a gulp task which might fail under certain circumstances.

                  gulp.task('favicon', function () {
                    try {
                      require('child_process').execSync('icotool --version');
                    } catch( e ) {
                      var err = new Error( 'Unix bash and icotool required for generating favicon' );
                      throw err;
                    }
                  
                    return gulp.src('', {read: false})
                      .pipe(shell([
                        './generate-favicon.sh'
                      ]));
                  });
                  

                  When running my task via gulp and running into the error, the error will be presented rather ugly. I would like to present the error in a way as it is done by e.g. jslint gulp-util's PluginError.

                  It actually works to just create a PluginError there and throw it but that doesn't seem quite right. Another solution not that nice would be to set

                  err.showStack = false;
                  

                  for at least a little nicer error output. A gulp.task.Error would be nice.

                  解決方案

                  From what I've seen its not great to throw an error from gulp. But I found this blog entry that I used to work for me.

                  http://gotofritz.net/blog/geekery/how-to-generate-error-in-gulp-task/

                  Edit: gulp-util has been deprecated. Instead, use the plugin-error package.

                  My Example:

                  var gulp = require('gulp');
                  var error = require('plugin-error');
                  gulp.task('deploy', function(cb) {
                    if(typeof(specialId) === 'undefined') {
                      var err = new PluginError({
                        plugin: 'deploy',
                        message: 'specialId is empty.'
                      });
                    }
                  }
                  

                  這篇關于在 gulp 任務中很好地拋出錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

                    • <bdo id='dF34H'></bdo><ul id='dF34H'></ul>
                      <legend id='dF34H'><style id='dF34H'><dir id='dF34H'><q id='dF34H'></q></dir></style></legend>

                            <tbody id='dF34H'></tbody>

                          <small id='dF34H'></small><noframes id='dF34H'>

                          <i id='dF34H'><tr id='dF34H'><dt id='dF34H'><q id='dF34H'><span id='dF34H'><b id='dF34H'><form id='dF34H'><ins id='dF34H'></ins><ul id='dF34H'></ul><sub id='dF34H'></sub></form><legend id='dF34H'></legend><bdo id='dF34H'><pre id='dF34H'><center id='dF34H'></center></pre></bdo></b><th id='dF34H'></th></span></q></dt></tr></i><div class="muowqo2" id='dF34H'><tfoot id='dF34H'></tfoot><dl id='dF34H'><fieldset id='dF34H'></fieldset></dl></div>

                            <tfoot id='dF34H'></tfoot>

                          • 主站蜘蛛池模板: 电伴热系统施工_仪表电伴热保温箱厂家_沃安电伴热管缆工业技术(济南)有限公司 | 武汉不干胶印刷_标签设计印刷_不干胶标签印刷厂 - 武汉不干胶标签印刷厂家 | 卡诺亚轻高定官网_卧室系统_整家定制_定制家居_高端定制_全屋定制加盟_定制家具加盟_定制衣柜加盟 | 自清洗过滤器_全自动过滤器_全自动反冲洗过滤器_量子过滤器-滑漮滴 | 散热器厂家_暖气片_米德尔顿散热器| 无锡网站建设-做网站-建网站-网页设计制作-阿凡达建站公司 | 点胶机_点胶阀_自动点胶机_智能点胶机_喷胶机_点胶机厂家【欧力克斯】 | 无锡网站建设_企业网站定制-网站制作公司-阿凡达网络 | 臭氧实验装置_实验室臭氧发生器-北京同林臭氧装置网 | 广西绿桂涂料--承接隔热涂料、隔音涂料、真石漆、多彩仿石漆等涂料工程双包施工 | 解放卡车|出口|济南重汽|报价大全|山东三维商贸有限公司 | 丝印油墨_水性油墨_环保油墨油漆厂家_37国际化工 | 工业铝型材生产厂家_铝合金型材配件批发精加工定制厂商 - 上海岐易铝业 | 宏源科技-房地产售楼系统|线上开盘系统|售楼管理系统|线上开盘软件 | 生产加气砖设备厂家很多,杜甫机械加气砖设备价格公道 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 代理记账_公司起名核名_公司注册_工商注册-睿婕实业有限公司 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 广州小程序开发_APP开发公司_分销商城系统定制_小跑科技 | 电动不锈钢套筒阀-球面偏置气动钟阀-三通换向阀止回阀-永嘉鸿宇阀门有限公司 | 膜片万向弹性联轴器-冲压铸造模具「沧州昌运模具」 | 大通天成企业资质代办_承装修试电力设施许可证_增值电信业务经营许可证_无人机运营合格证_广播电视节目制作许可证 | 高中学习网-高考生信息学习必备平台| 丙烷/液氧/液氮气化器,丙烷/液氧/液氮汽化器-无锡舍勒能源科技有限公司 | 骨密度仪-骨密度测定仪-超声骨密度仪-骨龄测定仪-天津开发区圣鸿医疗器械有限公司 | 东莞猎头公司_深圳猎头公司_广州猎头公司-广东万诚猎头提供企业中高端人才招聘服务 | 广东恩亿梯电源有限公司【官网】_UPS不间断电源|EPS应急电源|模块化机房|电动汽车充电桩_UPS电源厂家(恩亿梯UPS电源,UPS不间断电源,不间断电源UPS) | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 厂房出售_厂房仓库出租_写字楼招租_土地出售-中苣招商网-中苣招商网 | 探鸣起名网-品牌起名-英文商标起名-公司命名-企业取名包满意 | 临时厕所租赁_玻璃钢厕所租赁_蹲式|坐式厕所出租-北京慧海通 | 金刚网,金刚网窗纱,不锈钢网,金刚网厂家- 河北萨邦丝网制品有限公司 | 森旺-A级防火板_石英纤维板_不燃抗菌板装饰板_医疗板 | 工程管道/塑料管材/pvc排水管/ppr给水管/pe双壁波纹管等品牌管材批发厂家-河南洁尔康建材 | 路面机械厂家 | 厂房出租-厂房规划-食品技术-厂房设计-厂房装修-建筑施工-设备供应-设备求购-龙爪豆食品行业平台 | 广东泵阀展|阀门展-广东国际泵管阀展览会 | 集装箱标准养护室-集装箱移动式养护室-广州璟业试验仪器有限公司 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | AGV叉车|无人叉车|AGV智能叉车|AGV搬运车-江西丹巴赫机器人股份有限公司 |