BLUE
PHP 7.4.33
Path:
/var/www/podio-api-client/node_modules/makeerror
Run
Logout
Edit File
Size: 1.60 KB
Close
/var/www/podio-api-client/node_modules/makeerror/readme.md
Text
Base64
makeerror [](http://travis-ci.org/nshah/nodejs-makeerror) ========= A library to make errors. Basics ------ Makes an Error constructor function with the signature below. All arguments are optional, and if the first argument is not a `String`, it will be assumed to be `data`: ```javascript function(message, data) ``` You'll typically do something like: ```javascript var makeError = require('makeerror') var UnknownFileTypeError = makeError( 'UnknownFileTypeError', 'The specified type is not known.' ) var er = UnknownFileTypeError() ``` `er` will have a prototype chain that ensures: ```javascript er instanceof UnknownFileTypeError er instanceof Error ``` Templatized Error Messages -------------------------- There is support for simple string substitutions like: ```javascript var makeError = require('makeerror') var UnknownFileTypeError = makeError( 'UnknownFileTypeError', 'The specified type "{type}" is not known.' ) var er = UnknownFileTypeError({ type: 'bmp' }) ``` Now `er.message` or `er.toString()` will return `'The specified type "bmp" is not known.'`. Prototype Hierarchies --------------------- You can create simple hierarchies as well using the `prototype` chain: ```javascript var makeError = require('makeerror') var ParentError = makeError('ParentError') var ChildError = makeError( 'ChildError', 'The child error.', { proto: ParentError() } ) var er = ChildError() ``` `er` will have a prototype chain that ensures: ```javascript er instanceof ChildError er instanceof ParentError er instanceof Error ```
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
lib
DIR
-
drwxr-xr-x
2023-12-27 12:33:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.travis.yml
35 B
lrw-r--r--
2023-12-27 12:33:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.46 KB
lrw-r--r--
2023-12-27 12:33:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
452 B
lrw-r--r--
2023-12-27 12:33:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
1.60 KB
lrw-r--r--
2023-12-27 12:33:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).