Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 5, 2022
1 parent 684c80e commit 2ad256b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/error/modern/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import mergeErrorCause from 'merge-error-cause'
// Error handler that normalizes an error, merge its `error.cause` and ensure
// its type is among an allowed list of types.
// Otherwise, assign a default SystemError type.
export const onError = function (ErrorTypes, SystemError, error) {
export const onErrorHandler = function (ErrorTypes, SystemError, error) {
const errorA = mergeErrorCause(error)

if (ErrorTypes.some((ErrorType) => errorA instanceof ErrorType)) {
Expand Down
6 changes: 3 additions & 3 deletions src/error/modern/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line n/file-extension-in-import, import/no-unassigned-import
import 'error-cause/auto'

import { onError } from './handler.js'
import { onErrorHandler } from './handler.js'
import { getOpts } from './opts.js'
import {
validateErrorNames,
Expand All @@ -24,10 +24,10 @@ export const modernErrors = function (errorNames, opts) {
const { onCreate } = getOpts(opts)
const SystemError = createSystemError()
const ErrorTypes = createErrorTypes(errorNames, onCreate)
const onErrorHandler = onError.bind(
const onError = onErrorHandler.bind(
undefined,
Object.values(ErrorTypes),
SystemError,
)
return { ...ErrorTypes, onError: onErrorHandler }
return { ...ErrorTypes, onError }
}

0 comments on commit 2ad256b

Please sign in to comment.