Skip to content

In HttpException response showing status code at the beginning. #11591

Closed Answered by YuriiMotov
mithun2003 asked this question in Questions
Discussion options

You must be logged in to vote

You can create your own exception class, inherit it from HTTPException and redefine __str__ method as you need:

class MyHTTPException(HTTPException):
    def __str__(self):
        return self.detail

Then use MyHTTPException instead of HTTPException

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants