(message, type = ErrorTypes.UNKNOWN, userMessage = null, context = {})
| 345 | } |
| 346 | |
| 347 | export function createError(message, type = ErrorTypes.UNKNOWN, userMessage = null, context = {}) { |
| 348 | const normalizedContext = { |
| 349 | ...context, |
| 350 | errorCode: context?.errorCode || getDefaultErrorCodeByType(type) |
| 351 | }; |
| 352 | |
| 353 | return new TitanBotError(message, type, userMessage, normalizedContext); |
| 354 | } |
| 355 | |
| 356 | export default { |
| 357 | ErrorTypes, |
no test coverage detected