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