File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
packages/backend/src/apps/aisay/actions/use-generalised-model Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import appConfig from '@/config/app'
44import StepError from '@/errors/step'
55
66import { getToken } from '../../auth/get-token'
7+ import { parseError } from '../../common/error-parser'
78import { getAttachmentsFromS3 , getValidationError } from '../../common/utils'
89
910import getDataOutMetadata from './get-data-out-metadata'
@@ -111,21 +112,13 @@ const action: IRawAction = {
111112 $ . setActionItem ( { raw : { ...res . data } } )
112113 } catch ( err ) {
113114 console . error ( err )
114- if ( err . response . data . message === `Request Too Long` ) {
115- throw new StepError (
116- 'File too large' ,
117- 'Please try again with a smaller file.' ,
118- $ . step . position ,
119- $ . app . name ,
120- )
121- } else {
122- throw new StepError (
123- 'Failed to call generalised model' ,
124- 'Please try again.' ,
125- $ . step . position ,
126- $ . app . name ,
127- )
128- }
115+ const { stepErrorName, stepErrorSolution } = parseError ( err )
116+ throw new StepError (
117+ stepErrorName ,
118+ stepErrorSolution ,
119+ $ . step . position ,
120+ $ . app . name ,
121+ )
129122 }
130123 } ,
131124} satisfies IRawAction
You can’t perform that action at this time.
0 commit comments