Skip to content

Commit

Permalink
Updated exception msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Alopalao committed Nov 9, 2023
1 parent cec922c commit f4cf741
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,7 @@ def set_tag_range(self, request: Request) -> JSONResponse:
interface.set_tag_ranges(ranges, tag_type)
self.handle_on_interface_tags(interface)
except KytosTagError as err:
detail = f"Error when setting tag ranges: {err}"
raise HTTPException(400, detail=detail)
raise HTTPException(400, detail=str(err))
return JSONResponse("Operation Successful", status_code=200)

@rest('v3/interfaces/{interface_id}/tag_ranges', methods=['DELETE'])
Expand All @@ -523,8 +522,7 @@ def delete_tag_range(self, request: Request) -> JSONResponse:
interface.remove_tag_ranges(tag_type)
self.handle_on_interface_tags(interface)
except KytosTagError as err:
detail = f"Error with tag_type. {err}"
raise HTTPException(400, detail=detail)
raise HTTPException(400, detail=str(err))
return JSONResponse("Operation Successful", status_code=200)

@rest('v3/interfaces/tag_ranges', methods=['GET'])
Expand Down

0 comments on commit f4cf741

Please sign in to comment.