samchon / nestia-helper

NestJS helper with Type level
MIT License
34 stars 3 forks source link

Let `EncryptedBody` to throw 400 error when decryptoin has been failed #12

Closed samchon closed 2 years ago

samchon commented 2 years ago

When client sends wrong request body content and it generrates the exception from the AesPkcs5.decrypt() in the server side, it becomes the 500 internal server error. It seems not appropriate. Change the EncryptBody() to throw 400 bad request error for that case, therefore let client developer to fix the bug by himself.