mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
feat: return security errors in the SIP-40 format (#9796)
This commit is contained in:
@@ -26,8 +26,9 @@ import COMMON_ERR_MESSAGES from './errorMessages';
|
||||
export type ClientErrorObject = {
|
||||
error: string;
|
||||
errors?: SupersetError[];
|
||||
severity?: string;
|
||||
link?: string;
|
||||
message?: string;
|
||||
severity?: string;
|
||||
stacktrace?: string;
|
||||
} & Partial<SupersetClientResponse>;
|
||||
|
||||
@@ -54,6 +55,7 @@ export default function getClientErrorObject(
|
||||
// Backwards compatibility for old error renderers with the new error object
|
||||
if (error.errors && error.errors.length > 0) {
|
||||
error.error = error.description = error.errors[0].message;
|
||||
error.link = error.errors[0]?.extra?.link;
|
||||
}
|
||||
|
||||
if (error.stack) {
|
||||
|
||||
Reference in New Issue
Block a user