feat: error log errors in action and triggers

This commit is contained in:
Ali BARIN
2023-05-24 10:14:57 +00:00
parent aabf2a1c79
commit 9701c98af9
2 changed files with 6 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import Execution from '../models/execution';
import ExecutionStep from '../models/execution-step';
import computeParameters from '../helpers/compute-parameters';
import globalVariable from '../helpers/global-variable';
import { logger } from '../helpers/logger';
import HttpError from '../errors/http';
import EarlyExitError from '../errors/early-exit';
import AlreadyProcessedError from '../errors/already-processed';
@@ -53,6 +54,8 @@ export const processAction = async (options: ProcessActionOptions) => {
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
if (!shouldNotConsiderAsError) {
logger.error(error);
if (error instanceof HttpError) {
$.actionOutput.error = error.details;
} else {

View File

@@ -3,6 +3,7 @@ import globalVariable from '../helpers/global-variable';
import EarlyExitError from '../errors/early-exit';
import AlreadyProcessedError from '../errors/already-processed';
import HttpError from '../errors/http';
import { logger } from '../helpers/logger';
type ProcessFlowOptions = {
flowId: string;
@@ -35,6 +36,8 @@ export const processFlow = async (options: ProcessFlowOptions) => {
const shouldNotConsiderAsError = shouldEarlyExit || shouldNotProcess;
if (!shouldNotConsiderAsError) {
logger.error(error);
if (error instanceof HttpError) {
$.triggerOutput.error = error.details;
} else {