Browse Source

Informative error messages instead of "Internal error" #40

pull/1/head
rozetko 6 years ago
parent
commit
e571261249
  1. 4
      server/src/routes/anomalies.ts
  2. 2
      server/src/routes/segments.ts

4
server/src/routes/anomalies.ts

@ -100,7 +100,7 @@ async function createAnomaly(ctx: Router.IRouterContext) {
ctx.response.status = 500; ctx.response.status = 500;
ctx.response.body = { ctx.response.body = {
code: 500, code: 500,
message: 'Internal error' message: `Anomaly creation error: ${e.message}`
}; };
} }
} }
@ -124,7 +124,7 @@ function deleteAnomaly(ctx: Router.IRouterContext) {
ctx.response.status = 500; ctx.response.status = 500;
ctx.response.body = { ctx.response.body = {
code: 500, code: 500,
message: 'Internal error' message: `Anomaly deletion error: ${e.message}`
}; };
} }
} }

2
server/src/routes/segments.ts

@ -66,7 +66,7 @@ async function updateSegments(ctx: Router.IRouterContext) {
ctx.response.status = 500; ctx.response.status = 500;
ctx.response.body = { ctx.response.body = {
code: 500, code: 500,
message: 'Internal error' message: `Learning error: ${e.message}`
}; };
} }
} }

Loading…
Cancel
Save