FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.addException() function

fcf.addException(string a_messageName, string a_messageText)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Registers an exception name for fcf.Exception objects.

Arguments

string a_messageName
- Exception name

string a_messageText
- A tokenized string that will be output as a human-readable error message.

Example: Function appklication

fcf.addException("TEST_EXCEPTION", "Test exception: @{{value}}@"); let error = new fcf.Exception("TEST_EXCEPTION", {value: 1}); console.log(error.toString(true));

Output:

Test exception: 1 Stack: Object.test (/home/user/projects/Exception.js:9:13) fcf.Actions. (/home/user/projects/node_module/fcf-framework-unitest/unitest.js:615:26) fcf.Actions._execute (/home/user/projects/node_module/fcf-framework-core/fcf.js:3127:24) fcf.Actions.then (/home/user/projects/node_module/fcf-framework-core/fcf.js:2575:16) Namespace.Unitest._runLocalTests (/home/user/projects/node_module/fcf-framework-unitest/unitest.js:611:14) fcf.Actions. (/home/user/projects/node_module/fcf-framework-unitest/unitest.js:533:25) fcf.Actions._execute (/home/user/projects/node_module/fcf-framework-core/fcf.js:3132:24) Object.complete (/home/user/project/node_modules/fcf-framework-core/fcf.js:3091:18) (/home/user/project/node_modules/fcf-framework-core/fcf.js:3146:17)