Am 30.04.2020 um 22:56 schrieb Dan Campbell: > 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. >
According to the German Wikipedia, some software vendors use 9xx for proprietary error codes, which have never been mentioned in the RFC. They are probably save for non-standard use. https://de.wikipedia.org/wiki/HTTP-Statuscode#9xx_%E2%80%93_Propriet%C3%A4re_Fehler -- https://mail.python.org/mailman/listinfo/python-list