What user-defined request error levels are recommended?

Dan Campbell dcwhatthe at gmail.com
Thu Apr 30 16:56:42 EDT 2020


On Thursday, April 30, 2020 at 4:42:41 PM UTC-4, Ed Leafe wrote:
> On Apr 30, 2020, at 15:14, dc wrote:
> > 
> > Hi, what range of error codes are recommended, if we wanted to return a user-defined code?
> > 
> > Obviously, we don't want to use a code in the 200+ range, or the 400+ range, e.g.
> > 
> > I want to throw, or just return, a code that represents that the size of a web page (len(response.content)) is less than the expected size.
> 
> You can create your own internal codes as long as they don’t clash with the standard code. If the custom code is for a success, a 2xx code would be appropriate. If it is a user error, you could use a 4xx code.
> 
> However, I would prefer to use the standard codes, and add a custom header with more information on the issue.
> 
> 
> -- Ed Leafe

Ok, I'll try to find the the 400s list.  My concern is that a future library will use the 400+ code that I choose.


More information about the Python-list mailing list