Skip to content

Commit

Permalink
Show received value on incorrect option value error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Webster committed Dec 3, 2024
1 parent 09ca65b commit 02c632f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function createDB(opts?: ServerOptions) {

if (!OPTION_TYPE_CHECKS[opt].check(suppliedOpts[opt])) {
//Supplied option failed the check
throw OPTION_TYPE_CHECKS[opt].errorMessage
throw `${OPTION_TYPE_CHECKS[opt].errorMessage} | Received value: ${suppliedOpts[opt]} (type: ${typeof suppliedOpts[opt]})`
}

if (suppliedOpts[opt] !== undefined) {
Expand Down

0 comments on commit 02c632f

Please sign in to comment.