Only show message on just request/exec flow operations (#18167)

* Only show message on just request/exec flow operations

* Add ConnorSimply to contributors

* Change to instanceof BaseException
This commit is contained in:
Connor
2023-04-13 10:33:19 -05:00
committed by GitHub
parent 0bb02cb78c
commit 2bcd0e4ba4
2 changed files with 6 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ import getDatabase from './database/index.js';
import emitter from './emitter.js';
import env from './env.js';
import * as exceptions from './exceptions/index.js';
import { BaseException } from '@directus/exceptions';
import logger from './logger.js';
import { getMessenger } from './messenger.js';
import { ActivityService } from './services/activity.js';
@@ -420,8 +421,9 @@ class FlowManager {
} catch (error) {
let data;
if (error instanceof Error) {
// If the error is instance of Error, use the message of it as the error data
if (error instanceof BaseException) {
data = { message: error.message, code: error.code, extensions: error.extensions, status: error.status };
} else if (error instanceof Error) {
data = { message: error.message };
} else if (typeof error === 'string') {
// If the error is a JSON string, parse it and use that as the error data

View File

@@ -18,4 +18,5 @@
- knulpi
- david-zacharias
- hanneskuettner
- JoshTheDerf
- JoshTheDerf
- ConnorSimply