Skip to content

Commit

Permalink
twister: add trace print in exception
Browse files Browse the repository at this point in the history
add trace print when exception happens

Signed-off-by: Hake Huang <[email protected]>
  • Loading branch information
hakehuang committed Nov 14, 2024
1 parent 81f3270 commit 01598ad
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/pylib/twister/twisterlib/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@
#
# Copyright (c) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import traceback

class TwisterException(Exception):
pass
print(traceback.format_exc())


class TwisterRuntimeError(TwisterException):
pass
print(traceback.format_exc())


class ConfigurationError(TwisterException):
def __init__(self, cfile, message):
TwisterException.__init__(self, str(cfile) + ": " + message)
print(traceback.format_exc())


class BuildError(TwisterException):
pass
print(traceback.format_exc())


class ExecutionError(TwisterException):
pass
print(traceback.format_exc())


class StatusAttributeError(TwisterException):
def __init__(self, cls : type, value):
msg = f'{cls.__name__} assigned status {value}, which could not be cast to a TwisterStatus.'
super().__init__(msg)
print(traceback.format_exc())

0 comments on commit 01598ad

Please sign in to comment.