Skip to content

Commit

Permalink
fix: Fix error type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Mar 9, 2022
1 parent e6e95e9 commit 52ae3b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export function isBlurhashValid(blurhash: string): { isValid: true } | { isValid
try {
validateBlurhash(blurhash);
} catch (error) {
return { isValid: false, errorReason: error.message };
const message = error instanceof Error ? error.message : JSON.stringify(error);
return { isValid: false, errorReason: message };
}

return { isValid: true };
Expand Down

0 comments on commit 52ae3b5

Please sign in to comment.