Skip to content

Incorrect Error Constructor Usage #2803

@nileshpahari

Description

@nileshpahari

Describe the bug
In frontend/src/components/ModuleForm.tsx:289 and frontend/src/app/api/auth/[...nextauth]/route.ts:21,35
Error is constructed with two arguments. Error only accepts a single message string, so the original error is not preserved.

Current implementation

throw new Error('mssg...', err)

Fix

throw new Error(`mssg..., ${err}`)

To Reproduce
N/A

Expected behavior
N/A

Are you going to work on fixing this?

  • Yes
  • No

Screenshots
N/A

Desktop (please complete the following information):

  • OS: N/A
  • Browser: N/A
  • Version: N/A

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A
  • Version: N/A

Additional context
frontend/src/components/ModuleForm.tsx:289
frontend/src/app/api/auth/[...nextauth]/route.ts:21,35

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions