scripts/release/error.py
author Sverre Rabbelier <srabbelier@gmail.com>
Sat, 12 Sep 2009 00:36:49 +0200
changeset 2898 ac5f77cd6046
parent 1981 8cfb054b73b2
permissions -rw-r--r--
Fix 500 when saving /site/edit without email When saving /site/edit with no no_reply_email set, a 500 error page would be returned due to an empty value being passed as value to the datastore (which is not allowed for email fields).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1822
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     1
# Copyright 2009 the Melange authors.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     2
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     3
# Licensed under the Apache License, Version 2.0 (the "License");
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     4
# you may not use this file except in compliance with the License.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     5
# You may obtain a copy of the License at
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     6
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     7
#   http://www.apache.org/licenses/LICENSE-2.0
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     8
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     9
# Unless required by applicable law or agreed to in writing, software
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    10
# distributed under the License is distributed on an "AS IS" BASIS,
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    12
# See the License for the specific language governing permissions and
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    13
# limitations under the License.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    14
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    15
__authors__ = [
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    16
    # alphabetical order by last name, please
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    17
    '"David Anderson" <dave@natulte.net>',
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    18
    ]
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    19
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    20
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    21
class Error(Exception):
1835
3f30b7b14c57 Fix indentation to match Melange/Google style.
David Anderson <david.jc.anderson@gmail.com>
parents: 1822
diff changeset
    22
  """Base class for release script exceptions."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    23
  pass
1849
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    24
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    25
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    26
class ObstructionError(Error):
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    27
  """An operation was obstructed by existing data."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    28
  pass
1849
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    29
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    30
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    31
class ExpectationFailed(Error):
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    32
  """An unexpected state was encountered by an automated step."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    33
  pass
1981
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    34
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    35
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    36
class AbortedByUser(Error):
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    37
  """The operation was aborted by the user."""
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    38
  pass