Path: blob/master/src/sage/dev/user_interface_error.py
8815 views
r"""1User interface errors23This module provides subclasses of ``RuntimeError`` to indicate error4conditions in the user interface.56AUTHORS:78- Julian Rueth: initial version910"""11#*****************************************************************************12# Copyright (C) 2013 Julian Rueth <[email protected]>13#14# Distributed under the terms of the GNU General Public License (GPL)15# as published by the Free Software Foundation; either version 2 of16# the License, or (at your option) any later version.17# http://www.gnu.org/licenses/18#*****************************************************************************192021class OperationCancelledError(RuntimeError):22r"""23Indicates that the user cancelled an interactive action, e.g., the user was24asked to edit a file but left the editor with a non-zero exit code.2526EXAMPLES::2728sage: from sage.dev.user_interface_error import OperationCancelledError29sage: raise OperationCancelledError("cancelled")30Traceback (most recent call last):31...32OperationCancelledError: cancelled33"""34def __init__(self, reason):35r"""36Initialization.3738EXAMPLES::3940sage: from sage.dev.user_interface_error import OperationCancelledError41sage: type(OperationCancelledError("cancelled"))42<class 'sage.dev.user_interface_error.OperationCancelledError'>43"""44RuntimeError.__init__(self, reason)454647