feat: error log errors in action and triggers
This commit is contained in:
@@ -4,6 +4,7 @@ import Execution from '../models/execution';
|
|||||||
import ExecutionStep from '../models/execution-step';
|
import ExecutionStep from '../models/execution-step';
|
||||||
import computeParameters from '../helpers/compute-parameters';
|
import computeParameters from '../helpers/compute-parameters';
|
||||||
import globalVariable from '../helpers/global-variable';
|
import globalVariable from '../helpers/global-variable';
|
||||||
|
import { logger } from '../helpers/logger';
|
||||||
import HttpError from '../errors/http';
|
import HttpError from '../errors/http';
|
||||||
import EarlyExitError from '../errors/early-exit';
|
import EarlyExitError from '../errors/early-exit';
|
||||||
import AlreadyProcessedError from '../errors/already-processed';
|
import AlreadyProcessedError from '../errors/already-processed';
|
||||||
@@ -53,6 +54,8 @@ export const processAction = async (options: ProcessActionOptions) => {
|
|||||||
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
|
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
|
||||||
|
|
||||||
if (!shouldNotConsiderAsError) {
|
if (!shouldNotConsiderAsError) {
|
||||||
|
logger.error(error);
|
||||||
|
|
||||||
if (error instanceof HttpError) {
|
if (error instanceof HttpError) {
|
||||||
$.actionOutput.error = error.details;
|
$.actionOutput.error = error.details;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -3,6 +3,7 @@ import globalVariable from '../helpers/global-variable';
|
|||||||
import EarlyExitError from '../errors/early-exit';
|
import EarlyExitError from '../errors/early-exit';
|
||||||
import AlreadyProcessedError from '../errors/already-processed';
|
import AlreadyProcessedError from '../errors/already-processed';
|
||||||
import HttpError from '../errors/http';
|
import HttpError from '../errors/http';
|
||||||
|
import { logger } from '../helpers/logger';
|
||||||
|
|
||||||
type ProcessFlowOptions = {
|
type ProcessFlowOptions = {
|
||||||
flowId: string;
|
flowId: string;
|
||||||
@@ -35,6 +36,8 @@ export const processFlow = async (options: ProcessFlowOptions) => {
|
|||||||
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
|
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
|
||||||
|
|
||||||
if (!shouldNotConsiderAsError) {
|
if (!shouldNotConsiderAsError) {
|
||||||
|
logger.error(error);
|
||||||
|
|
||||||
if (error instanceof HttpError) {
|
if (error instanceof HttpError) {
|
||||||
$.triggerOutput.error = error.details;
|
$.triggerOutput.error = error.details;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user