Skip to content
Myr

docs: :exc:`TypeError`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by defuz · committed by defuz · parent 5562acf · Browse files · 5 files+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+5 added−5 removed

  • other:+5 added−5 removed

5 files+5 added−5 removed

modified:docs/quickstart.rst+1 added-1 removed
568 unmodified lines
569570 searchword = request.args.get('key', '')571572We recommend accessing URL parameters with `get` or by catching the573`KeyError` because users might change the URL and presenting them a 400573:exc:`KeyError` because users might change the URL and presenting them a 400574bad request page in that case is not user friendly.575576For a full list of methods and attributes of the request object, head over577to the :class:`~flask.request` documentation.
316 unmodified lines
modified:docs/upgrading.rst+1 added-1 removed
90 unmodified lines
91:exc:`~werkzeug.exceptions.BadRequest` exception instead of letting the92default :exc:`ValueError` bubble up. This has the advantage that you no93longer have to handle that error to avoid an internal server error showing94up for the user. If you were catching this down explicitly in the past95as `ValueError` you will need to change this.95as :exc:`ValueError` you will need to change this.9697Due to a bug in the test client Flask 0.7 did not trigger teardown98handlers when the test client was used in a with statement. This was99since fixed but might require some changes in your test suites if you
283 unmodified lines
modified:flask/app.py+1 added-1 removed
377 unmodified lines
378379 #: A list of functions that are called when :meth:`url_for` raises a380 #: :exc:`~werkzeug.routing.BuildError`. Each function registered here381 #: is called with `error`, `endpoint` and `values`. If a function382 #: returns ``None`` or raises a `BuildError` the next function is382 #: returns ``None`` or raises a :exc:`BuildError` the next function is383 #: tried.384 #:385 #: .. versionadded:: 0.9386 self.url_build_error_handlers = []
1523 unmodified lines
modified:flask/helpers.py+1 added-1 removed
246 unmodified lines
247 :param _external: if set to ``True``, an absolute URL is generated. Server248 address can be changed via ``SERVER_NAME`` configuration variable which249 defaults to `localhost`.250 :param _scheme: a string specifying the desired URL scheme. The `_external`251 parameter must be set to ``True`` or a `ValueError` is raised. The default251 parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default252 behavior uses the same scheme as the current request, or253 ``PREFERRED_URL_SCHEME`` from the :ref:`app configuration <config>` if no254 request context is available. As of Werkzeug 0.10, this also can be set255 to an empty string to build protocol-relative URLs.
648 unmodified lines
modified:flask/json.py+1 added-1 removed
58 unmodified lines
5960 def default(self, o):61 """Implement this method in a subclass such that it returns a62 serializable object for ``o``, or calls the base implementation (to63 raise a ``TypeError``).63 raise a :exc:`TypeError`).6465 For example, to support arbitrary iterators, you could implement66 default like this::67
183 unmodified lines