Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): fix error log in server #505

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/src/applications/application-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ export class ApplicationTaskService {
phase: ApplicationPhase.Deleted,
},
})
this.logger.log(`Application ${app.appid} updated to phase deleted`)
}
}
1 change: 1 addition & 0 deletions server/src/core/application.cr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class ApplicationCoreService {
const res = await this.k8sClient.coreV1Api.readNamespace(namespace)
return res.body
} catch (err) {
if (err?.response?.body?.reason === 'NotFound') return null
this.logger.error(err)
return null
}
Expand Down
6 changes: 2 additions & 4 deletions server/src/core/database.cr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ export class DatabaseCoreService {
)
return Database.fromObject(res.body)
} catch (err) {
if (err?.response?.body?.reason === 'NotFound') return null
this.logger.error(err)
if (err?.response?.body?.reason === 'NotFound') {
return null
}
throw err
return null
}
}

Expand Down
6 changes: 2 additions & 4 deletions server/src/core/gateway.cr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ export class GatewayCoreService {
)
return Gateway.fromObject(res.body)
} catch (err) {
if (err?.response?.body?.reason === 'NotFound') return null
this.logger.error(err)
if (err?.response?.body?.reason === 'NotFound') {
return null
}
throw err
return null
}
}

Expand Down
6 changes: 2 additions & 4 deletions server/src/core/oss-user.cr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ export class OSSUserCoreService {
)
return OSSUser.fromObject(res.body)
} catch (err) {
if (err?.response?.body?.reason === 'NotFound') return null
this.logger.error(err)
if (err?.response?.body?.reason === 'NotFound') {
return null
}
throw err
return null
}
}

Expand Down
1 change: 1 addition & 0 deletions server/src/instance/instance-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class InstanceTaskService {
phase: ApplicationPhase.Started,
},
})
this.logger.debug(`Application ${app.appid} updated to phase started`)
} catch (error) {
this.logger.error(error)
}
Expand Down
1 change: 1 addition & 0 deletions server/src/instance/instance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export class InstanceService {
)
return res.body
} catch (error) {
if (error?.response?.body?.reason === 'NotFound') return null
return null
}
}
Expand Down