elefrant-custom-errors:使用您自己的错误类型扩展 elefrant 错误

时间:2021-07-01 01:42:13
【文件属性】:
文件名称:elefrant-custom-errors:使用您自己的错误类型扩展 elefrant 错误
文件大小:6KB
文件格式:ZIP
更新时间:2021-07-01 01:42:13
JavaScript Elefrant 自定义错误 扩展 elefrant 错误并创建您自己的错误类型。 安装 $ elefrant install elefrant-custom-errors 用法 激活组件。 创建您自己的错误类型。 在组件文件夹中的lib/errors.js添加新类型。 function MyNewError ( message ) { restify . RestError . call ( this , { restCode : 'MyNewError' , statusCode : 418 , message : message , constructorOpt : MyNewError } ) ; } registerError ( restify , 'RestError' , MyNewError , 'MyNewError' ) ; 额外的 ###
【文件预览】:
elefrant-custom-errors-master
----package.json(1KB)
----readme.md(1KB)
----test()
--------test.js(381B)
----component.js(226B)
----Gruntfile.js(528B)
----wercker.yml(514B)
----.gitignore(640B)
----lib()
--------errors.js(2KB)
----.jshintrc(2KB)

网友评论