1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 07:20:05 +00:00

chore: additional param for stp/execute + desktop user in req

This commit is contained in:
Saad Jutt
2021-11-13 16:20:51 +05:00
parent cfdb67a049
commit 04a8626570
7 changed files with 106 additions and 229 deletions

View File

@@ -1,4 +1,4 @@
import express from 'express'
import express, { response } from 'express'
import path from 'path'
import {
Request,
@@ -92,12 +92,12 @@ const executeReturnRaw = async (
)
return result as string
} catch (err) {
} catch (err: any) {
throw {
code: 400,
status: 'failure',
message: 'Job execution failed.',
...(typeof err === 'object' ? err : { details: err })
error: typeof err === 'object' ? err.toString() : err
}
}
}
@@ -128,11 +128,11 @@ const executeReturnJson = async (
result: jsonResult.result,
log: jsonResult.log
}
} catch (err) {
} catch (err: any) {
throw {
status: 'failure',
message: 'Job execution failed.',
...(typeof err === 'object' ? err : { details: err })
error: typeof err === 'object' ? err.toString() : err
}
}
}