Skip to content

Commit

Permalink
chore(open-payments): handling unexpected error case
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurapov committed Apr 29, 2024
1 parent a327e72 commit 6eb6ade
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/open-payments/src/client/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ const handleError = async (
errorStatus = error.status
} else if (error instanceof Error) {
errorDescription = error.message
} else {
errorDescription = 'Received unexpected error'
deps.logger.error({ err: error })
}

const errorMessage = `Error making Open Payments ${requestType} request`
Expand All @@ -184,7 +187,7 @@ const handleError = async (
)

throw new OpenPaymentsClientError(errorMessage, {
description: errorDescription || 'Unknown',
description: errorDescription,
validationErrors,
status: errorStatus
})
Expand Down

0 comments on commit 6eb6ade

Please sign in to comment.