Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/types/nodemailer-6…
Browse files Browse the repository at this point in the history
….4.10
  • Loading branch information
nitrosx authored Sep 21, 2023
2 parents bf7f824 + 1414759 commit 8c915a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
24 changes: 18 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/instruments/instruments.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ export class InstrumentsController {
const instrument =
await this.instrumentsService.create(createInstrumentDto);
return instrument;
} catch (e) {
} catch (error) {
let message;
if (error instanceof Error) message = error.message;
else message = String(error);
// we'll proceed, but let's report it
throw new HttpException(
"Instrument with the same unique name already exists",
`Instrument with the same unique name already exists: ${message}`,
HttpStatus.BAD_REQUEST,
);
}
Expand Down

0 comments on commit 8c915a8

Please sign in to comment.