Skip to content

Commit

Permalink
Use instanceof Error rather than lodash _.isError
Browse files Browse the repository at this point in the history
Change-type: major
  • Loading branch information
Page- committed Jan 10, 2025
1 parent ec99776 commit b13fb81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config-loader/config-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const setup = (app: Express.Application) => {
);
} catch (err: any) {
const message = `Failed to execute '${model.modelName}' model from '${model.modelFile}'`;
if (_.isError(err)) {
if (err instanceof Error) {
err.message = `${message} due to: ${err.message}`;
throw err;
}
Expand Down
4 changes: 2 additions & 2 deletions src/sbvr-api/sbvr-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ export const runURI = async (

const [response] = await promise;

if (_.isError(response)) {
if (response instanceof Error) {
throw response;
}

Expand Down Expand Up @@ -1468,7 +1468,7 @@ const runODataRequest = (req: Express.Request, vocabulary: string) => {

const responses = results.map(
(result): Response | Response[] | HttpError => {
if (_.isError(result)) {
if (result instanceof Error) {
return convertToHttpError(result);
} else {
if (
Expand Down

0 comments on commit b13fb81

Please sign in to comment.