varde=require('define-exceptions');varSuperException=de.Exception(Error,'SuperException','Super new exception with %foo% and %bar%');console.log(SuperExceptioninstanceofError);// truethrownewSuperException({foo: 'test1',bar: 'test2'});//SuperException: Super new exception with test1 and test2
Multiple exceptions
//exceptions.jsvarde=require('define-exceptions');varDiException=de.Exception(Error,'DiException','Unknown MicroDi exception');varExceptions=de.Exceptions(DiException,{ProtoNotFound: 'Prototype not found in path %path%, params: %params%',});Exceptions.DiException=DiException;module.exports=Exceptions;