Exceptions
src.utils.exceptions.log_on_exception(logr: Any = None) -> Callable
Decorator to log any exception that occurs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logr | Any | Logger object to output any exception messages. | None |
Returns:
Type | Description |
---|---|
Callable | Wrapped function. |
Source code in src\utils\exceptions.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
src.utils.exceptions.return_on_exception(response: Optional[Any] = None) -> Callable
Decorator to handle any exception and return appropriate failure value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response | Any | None | Value to return if an exception occurs. | None |
Returns:
Type | Description |
---|---|
Callable | Wrapped function. |
Source code in src\utils\exceptions.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
src.utils.exceptions.try_photoshop(func) -> Callable
Decorator to handle trying to run a Photoshop action but allowing exceptions to fail silently.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func | Function being wrapped. | required |
Returns:
Type | Description |
---|---|
Callable | The wrapped function. |
Source code in src\utils\exceptions.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
src.utils.exceptions.get_photoshop_error_message(err: Exception) -> str
Gets a user-facing error message based on a given Photoshop access exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
err | Exception | Exception object containing the reason an action failed. | required |
Returns:
Type | Description |
---|---|
str | Proper user response for this exception. |
Source code in src\utils\exceptions.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
src.utils.exceptions.get_com_error(signed_int: int) -> str
Check for an error message for both the signed and unsigned version of a COMError code (HRESULT).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
signed_int | int | Signed integer representing a COMError exception. | required |
Returns:
Type | Description |
---|---|
str | The string error message associated with this COMError code. |
Source code in src\utils\exceptions.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|