Commit d6ea18ef authored by nanahira's avatar nanahira

fix

parent f9cf157b
Pipeline #8572 passed with stages
in 28 seconds
...@@ -26,7 +26,7 @@ export class AppController { ...@@ -26,7 +26,7 @@ export class AppController {
@Param('size', ParseIntPipe) size: number, @Param('size', ParseIntPipe) size: number,
) { ) {
if (size < 8 || size > 1000) { if (size < 8 || size > 1000) {
throw new BlankReturnMessageDto(400, 'Invalid size'); throw new BlankReturnMessageDto(400, 'Invalid size').toException();
} }
const buffer = await this.appService.getImage(username, size); const buffer = await this.appService.getImage(username, size);
return new StreamableFile(buffer, { return new StreamableFile(buffer, {
......
...@@ -17,7 +17,10 @@ export class ImageService extends ConsoleLogger { ...@@ -17,7 +17,10 @@ export class ImageService extends ConsoleLogger {
}); });
} catch (e) { } catch (e) {
this.error(`Error resizing image to ${size}: ${e.toString()}`); this.error(`Error resizing image to ${size}: ${e.toString()}`);
throw new BlankReturnMessageDto(500, 'Error resizing image'); throw new BlankReturnMessageDto(
500,
'Error resizing image',
).toException();
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment