/map now returns the correct error status code
This commit is contained in:
parent
adca51f6de
commit
a5aa9b6cf9
@ -59,10 +59,15 @@ export class MapController extends BaseController{
|
|||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
res.end(JSON.stringify(mapDetails));
|
res.end(JSON.stringify(mapDetails));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.message || e);
|
if (e.response) {
|
||||||
res.writeStatus("500 Internal Server Error")
|
res.writeStatus(e.response.status+" "+e.response.statusText);
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
res.end("An error occurred");
|
res.end("An error occurred: "+e.response.status+" "+e.response.statusText);
|
||||||
|
} else {
|
||||||
|
res.writeStatus("500 Internal Server Error")
|
||||||
|
this.addCorsHeaders(res);
|
||||||
|
res.end("An error occurred");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user