How to use the yay.errors.ParseError function in yay

To help you get started, we’ve selected a few yay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaybu / yaybu / yaybu / error.py View on Github external
""" A command from the Execute provider did not return the expected return
    code. """
    returncode = 133
    """ returns error code 133 to the invoking environment. """


class NoValidPolicy(ParseError):

    """ There is no valid policy for the resource. """

    returncode = 135
    """ returns error code 135 to the invoking environment. """


class NonConformingPolicy(ParseError):

    """ A policy has been specified, or has been chosen by default, but the
    parameters provided for the resource do not match those required for the
    policy. Check the documentation to ensure you have provided all required
    parameters. """
    returncode = 136
    """ returns error code 136 to the invoking environment. """


class NoSuitableProviders(ParseError):

    """ There are no suitable providers available for the policy and resource
    chosen. This may be because a provider has not been written for this
    Operating System or service, or it may be that you have not specified the
    parameters correctly. """
    returncode = 137
github yaybu / yaybu / yaybu / error.py View on Github external
class UnmodifiedAsset(ExecutionError):

    """ An asset was requested unnecesarily. This indicates an error in cache
    handling and should be filed as a bug against Yaybu. """
    returncode = 153


class ArgParseError(ParseError):

    """ Error parsing an argument that was applied to a config """
    returncode = 154


class TemplateError(ParseError):

    """ Error handling a template """
    returncode = 155


class InvalidCredsError(ExecutionError):

    """ Invalid credentials """
    returncode = 156


class ValueError(ExecutionError):

    """ Invalid value passed to a part """
    returncode = 157
github yaybu / yaybu / yaybu / error.py View on Github external
parameters. """
    returncode = 136
    """ returns error code 136 to the invoking environment. """


class NoSuitableProviders(ParseError):

    """ There are no suitable providers available for the policy and resource
    chosen. This may be because a provider has not been written for this
    Operating System or service, or it may be that you have not specified the
    parameters correctly. """
    returncode = 137
    """ returns error code 137 to the invoking environment. """


class TooManyProviders(ParseError):

    """ More than one provider matches the specified resource, and Yaybu is unable to choose between them. """
    returncode = 138
    """ returns error code 138 to the invoking environment. """


class InvalidProvider(ExecutionError):

    """ A provider is not valid. This is detected before any changes have been
    applied. """
    returncode = 139
    """ returns error code 139 to the invoking environment. """


class InvalidGroup(ExecutionError):
github yaybu / yaybu / yaybu / error.py View on Github external
All yaybu errors have a returncode, which is returned from the yaybu program
if these errors occur. This is primarily for the test harness, but feel free
to rely on these, they should be stable.

A returncode of less than 128 is an error from within the range specified in
the errno library, which contains the standard C error codes.

These may have been actually returned from a shell command, or they may be
based on our interpretation of the failure mode they represent. Resources will
define the errors they may return. """

import errno
from yay.errors import ParseError, NoMatching, EvaluationError  # noqa

ParseError.returncode = 128


class BindingError(ParseError):

    """ An error during policy binding. """

    returncode = 129
    """ returns error code 129 to the invoking environment. """


class ExecutionError(EvaluationError):

    """ Root of exceptions that are caused by execution failing in an unexpected way. """
    returncode = 130
    """ returns error code 130 to the invoking environment. """
github yaybu / yaybu / yaybu / error.py View on Github external
returncode = 135
    """ returns error code 135 to the invoking environment. """


class NonConformingPolicy(ParseError):

    """ A policy has been specified, or has been chosen by default, but the
    parameters provided for the resource do not match those required for the
    policy. Check the documentation to ensure you have provided all required
    parameters. """
    returncode = 136
    """ returns error code 136 to the invoking environment. """


class NoSuitableProviders(ParseError):

    """ There are no suitable providers available for the policy and resource
    chosen. This may be because a provider has not been written for this
    Operating System or service, or it may be that you have not specified the
    parameters correctly. """
    returncode = 137
    """ returns error code 137 to the invoking environment. """


class TooManyProviders(ParseError):

    """ More than one provider matches the specified resource, and Yaybu is unable to choose between them. """
    returncode = 138
    """ returns error code 138 to the invoking environment. """
github yaybu / yaybu / yaybu / error.py View on Github external
to rely on these, they should be stable.

A returncode of less than 128 is an error from within the range specified in
the errno library, which contains the standard C error codes.

These may have been actually returned from a shell command, or they may be
based on our interpretation of the failure mode they represent. Resources will
define the errors they may return. """

import errno
from yay.errors import ParseError, NoMatching, EvaluationError  # noqa

ParseError.returncode = 128


class BindingError(ParseError):

    """ An error during policy binding. """

    returncode = 129
    """ returns error code 129 to the invoking environment. """


class ExecutionError(EvaluationError):

    """ Root of exceptions that are caused by execution failing in an unexpected way. """
    returncode = 130
    """ returns error code 130 to the invoking environment. """


class DpkgError(ExecutionError):
github yaybu / yaybu / yaybu / error.py View on Github external
class AptError(ExecutionError):

    """ An apt command failed unrecoverably. """
    returncode = 132
    """ returns error code 132 to the invoking environment. """


class CommandError(ExecutionError):

    """ A command from the Execute provider did not return the expected return
    code. """
    returncode = 133
    """ returns error code 133 to the invoking environment. """


class NoValidPolicy(ParseError):

    """ There is no valid policy for the resource. """

    returncode = 135
    """ returns error code 135 to the invoking environment. """


class NonConformingPolicy(ParseError):

    """ A policy has been specified, or has been chosen by default, but the
    parameters provided for the resource do not match those required for the
    policy. Check the documentation to ensure you have provided all required
    parameters. """
    returncode = 136
    """ returns error code 136 to the invoking environment. """
github yaybu / yaybu / yaybu / error.py View on Github external
class MissingDependency(ExecutionError):

    """ A dependency required for a feature or provider is missing """
    returncode = 152


class UnmodifiedAsset(ExecutionError):

    """ An asset was requested unnecesarily. This indicates an error in cache
    handling and should be filed as a bug against Yaybu. """
    returncode = 153


class ArgParseError(ParseError):

    """ Error parsing an argument that was applied to a config """
    returncode = 154


class TemplateError(ParseError):

    """ Error handling a template """
    returncode = 155


class InvalidCredsError(ExecutionError):

    """ Invalid credentials """
    returncode = 156