chore: reorder error

This commit is contained in:
Faisal Amir 2025-08-14 12:02:47 +07:00
parent 10f3f7cea5
commit 6acdf22e41

View File

@ -37,16 +37,6 @@ export default function LoadModelErrorDialog() {
if (typeof error === 'string') return error if (typeof error === 'string') return error
if (typeof error === 'object') {
const errorObj = error as {
code?: string
message: string
details?: string
}
return errorObj.message
}
if (typeof error === 'object' && 'code' in error && 'message' in error) { if (typeof error === 'object' && 'code' in error && 'message' in error) {
const errorObj = error as { const errorObj = error as {
code?: string code?: string
@ -62,6 +52,16 @@ export default function LoadModelErrorDialog() {
return copyText return copyText
} }
if (typeof error === 'object') {
const errorObj = error as {
code?: string
message: string
details?: string
}
return errorObj.message
}
return JSON.stringify(error) return JSON.stringify(error)
} }