File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import Debug from 'debug'
22import { Response } from 'express'
3- import { BadRequestError } from 'src/error'
4- import { lockApi } from 'src/middleware/session'
3+ import { lockApi } from 'src/middleware'
54import { OpenApiRequestExt } from 'src/otomi-models'
65
76const debug = Debug ( 'otomi:api:v2:git' )
@@ -30,7 +29,9 @@ export const migrateGit = async (req: OpenApiRequestExt, res: Response): Promise
3029 try {
3130 remoteHasContent = await req . otomi . git . testRemoteConnection ( repoUrl , password , branch , username )
3231 } catch ( e : any ) {
33- throw new BadRequestError ( `Cannot connect to new git remote: ${ e . message } ` )
32+ const error = { message : `Cannot connect to new git remote: ${ e . message } ` , statusCode : 404 }
33+ res . json ( error )
34+ return
3435 }
3536
3637 // Write config + commit locally → push to new remote (if empty) → push to current remote
You can’t perform that action at this time.
0 commit comments