Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 47 additions & 22 deletions src/ansys/sherlock/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def __init__(self, message=None, error_array=None):
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Create life phase error: {error}" for error in self.error_array]
return [f"Add harmonic event error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Add harmonic event error: {self.message}"]
Expand Down Expand Up @@ -348,25 +348,35 @@ def str_itr(self):
class SherlockLoadRandomVibeProfileError(Exception):
"""Contains the error raised when loading random vibe properties."""

def __init__(self, message):
"""Initialize Error Message."""
def __init__(self, message=None, error_array=None):
"""Initialize error message."""
self.message = message
self.error_array = error_array

def __str__(self):
"""Format error message."""
return f"Load random vibe profile error: {self.message}"
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Load random vibe profile error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Load random vibe profile error: {self.message}"]


class SherlockLoadHarmonicProfileError(Exception):
"""Contains the error raised when loading a harmonic profile."""

def __init__(self, message):
def __init__(self, message=None, error_array=None):
"""Initialize error message."""
self.message = message
self.error_array = error_array

def __str__(self):
"""Format Error Message."""
return f"Load Harmonic profile error: {self.message}"
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Load harmonic profile error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Load harmonic profile error: {self.message}"]


class SherlockUpdateMountPointsByFileError(Exception):
Expand Down Expand Up @@ -524,13 +534,18 @@ def __str__(self):
class SherlockLoadThermalProfileError(Exception):
"""Contains the error raised when loading thermal profile."""

def __init__(self, message):
def __init__(self, message=None, error_array=None):
"""Initialize error message."""
self.message = message
self.error_array = error_array

def __str__(self):
"""Format error message."""
return f"Load thermal profile error: {self.message}"
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Load thermal profile error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Load thermal profile error: {self.message}"]


class SherlockRunAnalysisError(Exception):
Expand Down Expand Up @@ -572,13 +587,18 @@ def __str__(self):
class SherlockLoadShockProfileDatasetError(Exception):
"""Contains the error raised when loading shock profile dataset results in an error."""

def __init__(self, message):
def __init__(self, message=None, error_array=None):
"""Initialize error message."""
self.message = message
self.error_array = error_array

def __str__(self):
"""Initialize error message."""
return f"Load shock profile dataset error: {self.message}"
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Load shock profile dataset error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Load shock profile dataset error: {self.message}"]


class SherlockUpdateNaturalFrequencyPropsError(Exception):
Expand Down Expand Up @@ -752,13 +772,18 @@ def __str__(self):
class SherlockLoadShockProfilePulsesError(Exception):
"""Contains the error raised when loading shock profile pulses."""

def __init__(self, message):
def __init__(self, message=None, error_array=None):
"""Initialize error message."""
self.message = message
self.error_array = error_array

def __str__(self):
"""Format error message."""
return f"Load shock profile pulses error: {self.message}"
def str_itr(self):
"""Create list of error messages."""
if self.message is None:
return [f"Load shock profile pulses error: {error}" for error in self.error_array]

assert self.error_array is None
return [f"Load shock profile pulses error: {self.message}"]


class SherlockUpdatePcbModelingPropsError(Exception):
Expand Down
Loading