Skip to content

Commit

Permalink
Handle errors more concisely
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Jan 20, 2025
1 parent cf61522 commit 46b2d27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imports/dashboard/files/fileManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import FolderCreationDialog from './folderCreationDialog'
const euc: (uriComponent: string | number | boolean) => string =
typeof encodeURIComponent === 'function' ? encodeURIComponent : e => e.toString()
const errorMessage = (err: unknown) =>
err instanceof Error ? err.message : typeof err === 'string' ? err : JSON.stringify(err)
err instanceof Error ? err.message : (err?.toString() ?? 'Unknown error occurred!')
const editorExts = ['properties', 'json', 'yaml', 'yml', 'xml', 'js', 'log', 'sh', 'txt']

const FileManager = (props: {
Expand Down

0 comments on commit 46b2d27

Please sign in to comment.