summaryrefslogtreecommitdiffstats
path: root/build-root/emacs-lisp
AgeCommit message (Expand)AuthorFilesLines
2016-07-08fd-io-styleify for svmDave Barach1-25/+55
2016-07-08fd-io-styleify passDave Barach1-0/+45
2016-07-08Update emacs plugin skeletonDamjan Marion2-25/+16
2016-04-22Add clib_memcpy macro based on DPDK rte_memcpy implementationDamjan Marion1-1/+1
2016-03-28event logger skeletons, improve debug CLIDave Barach5-0/+132
2016-03-19Adminis-trivia - rename skel filesKeith Burns (alagalah)20-35/+35
2016-03-16Add VLIB_INIT_FUNCTION() to dual-loop-skelDave Wallace1-0/+13
2016-03-14Fix skel files to use <vppinfra/*.h> instead of <clib/*.h> whenDave Wallace4-9/+8
2016-01-19Shell script to run the emacs-skeleton plugin boilerplate generatorDave Barach1-0/+4
2016-01-04Add --with-plugin-toolkit to README, clean up unwanted filesDave Barach2-1/+3
2016-01-04Emacs-lisp scripts to generate complete vpp pluginsDave Barach12-4/+1271
2015-12-08Initial commit of vpp code.v1.0.0Ed Warnicke10-0/+1692
id='n45' href='#n45'>45 46 47 48 49 50 51 52 53 54 55
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Implementation of exceptions used in the wrk traffic generator.
"""


from robot.api import logger


class WrkError(Exception):
    """Exception(s) raised by the wrk traffic generator.

    When raising this exception, put this information to the message in this
    order:
     - short description of the encountered problem (parameter msg),
     - relevant messages if there are any collected, e.g., from caught
       exception (optional parameter details),
     - relevant data if there are any collected (optional parameter details).
    """

    def __init__(self, msg, details=''):
        """Sets the exception message and the level.

        :param msg: Short description of the encountered problem.
        :param details: Relevant messages if there are any collected, e.g.:
        from caught exception (optional parameter details), or relevant data if
        there are any collected (optional parameter details).
        :type msg: str
        :type details: str
        """

        super(WrkError, self).__init__()
        self._msg = msg
        self._details = details

        logger.error(self._msg)
        if self._details:
            logger.error(self._details)

    def __repr__(self):
        return repr(self._msg)

    def __str__(self):
        return str(self._msg)