2014-06-19 09:04:37 +02:00
|
|
|
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
|
|
|
|
|
2017-05-09 21:37:03 +02:00
|
|
|
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
|
2014-02-06 14:01:23 +01:00
|
|
|
#
|
|
|
|
# This file is part of qutebrowser.
|
|
|
|
#
|
|
|
|
# qutebrowser is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# qutebrowser is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2014-02-24 19:11:43 +01:00
|
|
|
"""Exception classes for commands modules.
|
2014-02-17 12:23:52 +01:00
|
|
|
|
|
|
|
Defined here to avoid circular dependency hell.
|
|
|
|
"""
|
|
|
|
|
2014-01-29 06:28:21 +01:00
|
|
|
|
2014-04-30 10:41:25 +02:00
|
|
|
class CommandError(Exception):
|
2014-02-07 20:21:50 +01:00
|
|
|
|
2016-07-05 08:34:03 +02:00
|
|
|
"""Raised when a command encounters an error while running."""
|
2014-05-14 18:00:40 +02:00
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class CommandMetaError(Exception):
|
|
|
|
|
2015-03-31 20:49:29 +02:00
|
|
|
"""Common base class for exceptions occurring before a command is run."""
|
2014-01-29 06:28:21 +01:00
|
|
|
|
|
|
|
|
2014-05-14 18:00:40 +02:00
|
|
|
class NoSuchCommandError(CommandMetaError):
|
2014-02-07 20:21:50 +01:00
|
|
|
|
2014-04-30 10:41:25 +02:00
|
|
|
"""Raised when a command wasn't found."""
|
2014-02-07 20:21:50 +01:00
|
|
|
|
2014-01-29 06:28:21 +01:00
|
|
|
pass
|
2014-04-25 10:10:58 +02:00
|
|
|
|
|
|
|
|
2014-09-03 10:47:27 +02:00
|
|
|
class ArgumentTypeError(CommandMetaError):
|
|
|
|
|
|
|
|
"""Raised when an argument had an invalid type."""
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2014-05-14 18:00:40 +02:00
|
|
|
class PrerequisitesError(CommandMetaError):
|
2014-04-30 10:41:25 +02:00
|
|
|
|
|
|
|
"""Raised when a cmd can't be used because some prerequisites aren't met.
|
2014-04-29 23:06:07 +02:00
|
|
|
|
2014-04-30 10:41:25 +02:00
|
|
|
This is raised for example when we're in the wrong mode while executing the
|
|
|
|
command, or we need javascript enabled but don't have done so.
|
|
|
|
"""
|
2014-04-29 23:06:07 +02:00
|
|
|
|
|
|
|
pass
|