debug-log mastodon error responses
This commit is contained in:
parent
d9d0adbc6f
commit
2aa3cf2731
2 changed files with 19 additions and 8 deletions
|
|
@ -65,6 +65,13 @@ export function getErrorData(error: unknown): MastodonError {
|
|||
return convertGenericError(error);
|
||||
}
|
||||
|
||||
if ('error' in error && typeof(error.error) === 'string') {
|
||||
// "error_description" is string, undefined, or not present.
|
||||
if (!('error_description' in error) || typeof(error.error_description) === 'string' || typeof(error.error_description) === 'undefined') {
|
||||
return error as MastodonError;
|
||||
}
|
||||
}
|
||||
|
||||
return convertUnknownError(error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue