File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,18 @@ export const getValidationErrorMessage = (error: unknown): string => {
110
110
return validationErrors . map ( ( error ) => error . detail ) . join ( "\n" ) ;
111
111
} ;
112
112
113
- export const getErrorDetail = ( error : unknown ) : string | null => {
113
+ export const getErrorDetail = ( error : unknown ) : string | undefined => {
114
114
if ( error instanceof Error ) {
115
115
return "Please check the developer console for more details." ;
116
116
}
117
+
117
118
if ( isApiError ( error ) ) {
118
- return error . response . data . detail ?? null ;
119
+ return error . response . data . detail ;
119
120
}
121
+
120
122
if ( isApiErrorResponse ( error ) ) {
121
- return error . detail ?? null ;
123
+ return error . detail ;
122
124
}
123
- return null ;
125
+
126
+ return undefined ;
124
127
} ;
You can’t perform that action at this time.
0 commit comments