Hi!
My app uses several pyhton packages for calculations and I would like to show the exception given in CLI to the user. How can I do this? I found the example below, but in the example I need to define the exception myself.
Thanks for the tip!
from viktor import UserExceptionclass
SomePythonClass:
def calculate_block_volume(self, params):
width = params.input.geometry.width
length = params.input.geometry.length
height = params.input.geometry.height
if not isinstance(width, (int, float)):
raise UserException("Input 'width' is not a number!")
if not isinstance(length, (int, float)):
raise UserException("Input 'length' is not a number!")
if not isinstance(height, (int, float)):
raise UserException("Input 'height' is not a number!")
return width * length * height