(func)
| 767 | |
| 768 | class="cm">// wrapper that we expose to the user for configure the custom error handler |
| 769 | function setErrorHandler (func) { |
| 770 | throwIfAlreadyStarted(class="st">'Cannot call "setErrorHandler"!') |
| 771 | |
| 772 | if (typeof func !== class="st">'function') { |
| 773 | throw new FST_ERR_ERROR_HANDLER_NOT_FN() |
| 774 | } |
| 775 | |
| 776 | if (!options.allowErrorHandlerOverride && this[kErrorHandlerAlreadySet]) { |
| 777 | throw new FST_ERR_ERROR_HANDLER_ALREADY_SET() |
| 778 | } else if (this[kErrorHandlerAlreadySet]) { |
| 779 | FSTWRN004() |
| 780 | } |
| 781 | |
| 782 | this[kErrorHandlerAlreadySet] = true |
| 783 | this[kErrorHandler] = buildErrorHandler(this[kErrorHandler], func.bind(this)) |
| 784 | return this |
| 785 | } |
| 786 | |
| 787 | function setChildLoggerFactory (factory) { |
| 788 | throwIfAlreadyStarted(class="st">'Cannot call "setChildLoggerFactory"!') |
nothing calls this directly
no test coverage detected