1.9.30 sync.
[gae.git] / python / google / appengine / api / mail_errors.py
blob5f22e167b8dd3a047d3fdb255e3bbc8cee113c2a
1 #!/usr/bin/env python
3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 """Exceptions raised my mail API."""
25 class Error(Exception):
26 """Base Mail error type."""
28 class BadRequestError(Error):
29 """Email is not valid."""
31 class InvalidSenderError(Error):
32 """Sender is not a permitted to send mail for this application."""
34 class InvalidEmailError(Error):
35 """Bad email set on an email field."""
37 class InvalidAttachmentTypeError(Error):
38 """Invalid file type for attachments. We don't send viruses!"""
40 class InvalidHeaderNameError(Error):
41 """Invalid name for mail header."""
43 class MissingRecipientsError(Error):
44 """No recipients specified in message."""
46 class MissingSenderError(Error):
47 """No sender specified in message."""
49 class MissingSubjectError(Error):
50 """Subject not specified in message."""
52 class MissingBodyError(Error):
53 """No body specified in message."""
55 class PayloadEncodingError(Error):
56 """Unknown payload encoding."""
58 class UnknownEncodingError(PayloadEncodingError):
59 """Raised when encoding is not known."""
61 class UnknownCharsetError(PayloadEncodingError):
62 """Raised when charset is not known."""