Skip to content

Conversation

GMishx
Copy link
Member

@GMishx GMishx commented Oct 10, 2023

Description

Use custom exceptions for handling HTTP error status codes instead of writing long if-else ladders. This makes code cleaner and easier to maintain.

At the same time, make small changes to make code more robust.

Changes

Create new exceptions for REST API and throw them in Controllers instead of writing long if-else ladders.

How to test

Test REST endpoints.

Use custom exceptions for handling HTTP error status codes instead of
writing long if-else ladders. This makes code cleaner and easier to
maintain.

At the same time, make small changes to make code more robust.

Signed-off-by: Gaurav Mishra <[email protected]>
Also fix typos in unit test and relevant API Documentation texts.

Signed-off-by: Gaurav Mishra <[email protected]>
@GMishx GMishx force-pushed the feat/api/use-exceptions branch from c21b6e2 to c10906d Compare October 11, 2023 07:15
@GMishx GMishx marked this pull request as ready for review October 11, 2023 07:34
@GMishx GMishx removed the WIP label Oct 11, 2023
Copy link
Member

@shaheemazmalmmd shaheemazmalmmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. tested with few endpoints seems good.

@shaheemazmalmmd shaheemazmalmmd merged commit b32b1a7 into fossology:master Oct 12, 2023
@shaheemazmalmmd shaheemazmalmmd deleted the feat/api/use-exceptions branch October 12, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants