Skip to content

Commit

Permalink
Add missing error logs in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 21, 2023
1 parent b5bda1c commit 5728771
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/src/api/ApiCaller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,26 @@ export class BackendAPICaller {

static async pauseMission(robotId: string): Promise<void> {
const path: string = 'robots/' + robotId + '/pause'
return BackendAPICaller.postControlMissionRequest(path, robotId)
return BackendAPICaller.postControlMissionRequest(path, robotId).catch((e) => {
console.error(`Failed to POST /${path}: ` + e)
throw e
})
}

static async resumeMission(robotId: string): Promise<void> {
const path: string = 'robots/' + robotId + '/resume'
return BackendAPICaller.postControlMissionRequest(path, robotId)
return BackendAPICaller.postControlMissionRequest(path, robotId).catch((e) => {
console.error(`Failed to POST /${path}: ` + e)
throw e
})
}

static async stopMission(robotId: string): Promise<void> {
const path: string = 'robots/' + robotId + '/stop'
return BackendAPICaller.postControlMissionRequest(path, robotId)
return BackendAPICaller.postControlMissionRequest(path, robotId).catch((e) => {
console.error(`Failed to POST /${path}: ` + e)
throw e
})
}

static async getMap(installationCode: string, mapName: string): Promise<Blob> {
Expand Down

0 comments on commit 5728771

Please sign in to comment.