Live data from Hacker News

418 I'm a teapot

developer.mozilla.org

31–40 of 195 posts

Re: 418 I'm a teapot

#31
post #17

I honestly use this a lot when I'm testing, because it's basically the only response that can show up where I know god damned well that it's only happening because I programmed it to happen under certain conditions. edit: a common one for me is that if any test passes a post request without a csrf token... sorry, I'm a teapot, because I forgot to add a csrf token to that form.

It’s still in my production code, usually in places where i don’t expect code to ever lead to.

It’s just my general “something particularly odd has happened” response.

Re: 418 I'm a teapot

#32

I came across this a while back that I enjoyed but is kinda just an “lol” but not super useful status code thing: https://github.com/3digitdev/Haiku-TTP-Codes Doesn’t have any for 418 yet though… a PR may be in order!

I'm a pot for tea // short and stout, that describes me // tip me over now.

Re: 418 I'm a teapot

#35
I've seen a 418 response on a production system once... on a simple request that took 5 seconds to be fullfiled.

Building integrations for duct-taped legacy systems in finance is fun.

Re: 418 I'm a teapot

#36
post #17

I honestly use this a lot when I'm testing, because it's basically the only response that can show up where I know god damned well that it's only happening because I programmed it to happen under certain conditions. edit: a common one for me is that if any test passes a post request without a csrf token... sorry, I'm a teapot, because I forgot to add a csrf token to that form.

I like to respond with 418 as the catch all response code for mock web services for requests that dont match any installed expected requests. The reasoning is sometimes 404 is a valid mock response for some test cases, so I needed the "404 for mocks" that would never appear on any legit service. Very clearly highlights when something is going wrong on a test.

Re: 418 I'm a teapot

#39
As an SRE, please don’t use this for internal tools to be cute. It’s not helpful, and in 5 years time when you’re long gone and something breaks at 2am, it’s incredibly frustrating.
Post reply on HN