Browse Source
The first thing someone will ask when someone sees this method is "Why doesn't `send` just accept `Attachment`?". This question is fair but it has an issue: exception propagation becomes confusing. When we save a file and write it to memory an HTTP request is sent similar to other API calls. Like all HTTP requests, these can fail. Since these requests denote failure using HTTPException, if it were to originate within `send` then it becomes confusing to know whether the attachment saving itself failed or whether the sending failed. For that reason, and to keep in-line with only 1 type of HTTP call per method, it doesn't make sense for `send` to support `Attachment`.pull/2498/head
1 changed files with 27 additions and 0 deletions
Loading…
Reference in new issue