Skip to content
Snippets Groups Projects
Commit ab97a2da authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: update error handling on post controller + update ghost insert script

parent 588f9bdf
No related branches found
No related tags found
2 merge requests!46Recette,!45Dev
......@@ -684,7 +684,7 @@
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": ["Infos"],
"tags": ["Infos", "Oullins"],
"authors": [
{
"id": "5951f5fca366002ebd5dbef7",
......@@ -806,7 +806,7 @@
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": ["Ressources"],
"tags": ["Ressources", "Oullins"],
"authors": [
{
"id": "5951f5fca366002ebd5dbef7",
......
import { Controller, Get, HttpService, Logger, Param, Query } from '@nestjs/common';
import { Controller, Get, HttpException, HttpService, HttpStatus, Logger, Param, Query } from '@nestjs/common';
import { Observable } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { ApiQuery } from '@nestjs/swagger';
......@@ -35,8 +35,7 @@ export class PostsController {
.pipe(
map((response) => response.data),
catchError((err) => {
Logger.error(err);
return new Observable();
throw new HttpException('Invalid structure id', HttpStatus.BAD_REQUEST);
})
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment