Remove default traceback logging to screen
This commit is contained in:
@ -181,7 +181,7 @@ View full execution history:
|
||||
3 Run My Pipeline 09:23:55 09:24:03 8.082s ❌ Error RuntimeError('Random failure!')
|
||||
```
|
||||
|
||||
Inspect traceback on failure:
|
||||
Inspect result by index:
|
||||
|
||||
```bash
|
||||
> history --result-index 0
|
||||
@ -189,7 +189,7 @@ Action(name='step_1', action=flaky_step, args=(), kwargs={}, retry=True, rollbac
|
||||
ok
|
||||
```
|
||||
|
||||
Print last result:
|
||||
Print last result includes tracebacks:
|
||||
|
||||
```bash
|
||||
> history --last-result
|
||||
|
@ -883,7 +883,13 @@ class Falyx:
|
||||
self, selected_command: Command, error: Exception
|
||||
) -> None:
|
||||
"""Handles errors that occur during the action of the selected command."""
|
||||
logger.exception("Error executing '%s': %s", selected_command.description, error)
|
||||
logger.debug(
|
||||
"[%s] '%s' failed with error: %s",
|
||||
selected_command.key,
|
||||
selected_command.description,
|
||||
error,
|
||||
exc_info=True,
|
||||
)
|
||||
self.console.print(
|
||||
f"[{OneColors.DARK_RED}]An error occurred while executing "
|
||||
f"{selected_command.description}:[/] {error}"
|
||||
@ -973,12 +979,7 @@ class Falyx:
|
||||
except Exception as error:
|
||||
context.exception = error
|
||||
await self.hooks.trigger(HookType.ON_ERROR, context)
|
||||
logger.error(
|
||||
"[run_key] Failed: %s — %s: %s",
|
||||
selected_command.description,
|
||||
type(error).__name__,
|
||||
error,
|
||||
)
|
||||
await self._handle_action_error(selected_command, error)
|
||||
raise FalyxError(
|
||||
f"[run_key] ❌ '{selected_command.description}' failed."
|
||||
) from error
|
||||
|
@ -149,14 +149,18 @@ class RetryHandler:
|
||||
sleep_delay = current_delay
|
||||
if self.policy.jitter > 0:
|
||||
sleep_delay += random.uniform(-self.policy.jitter, self.policy.jitter)
|
||||
|
||||
logger.debug(
|
||||
"[%s] Error: %s",
|
||||
name,
|
||||
last_error,
|
||||
)
|
||||
logger.info(
|
||||
"[%s] Retrying (%s/%s) in %ss due to '%s'...",
|
||||
name,
|
||||
retries_done,
|
||||
self.policy.max_retries,
|
||||
current_delay,
|
||||
last_error,
|
||||
last_error.__class__.__name__,
|
||||
)
|
||||
await asyncio.sleep(current_delay)
|
||||
try:
|
||||
@ -168,12 +172,17 @@ class RetryHandler:
|
||||
except Exception as retry_error:
|
||||
last_error = retry_error
|
||||
current_delay *= self.policy.backoff
|
||||
logger.debug(
|
||||
"[%s] Error: %s",
|
||||
name,
|
||||
retry_error,
|
||||
)
|
||||
logger.warning(
|
||||
"[%s] Retry attempt %s/%s failed due to '%s'.",
|
||||
name,
|
||||
retries_done,
|
||||
self.policy.max_retries,
|
||||
retry_error,
|
||||
retry_error.__class__.__name__,
|
||||
)
|
||||
|
||||
context.exception = last_error
|
||||
|
@ -1 +1 @@
|
||||
__version__ = "0.1.66"
|
||||
__version__ = "0.1.67"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "falyx"
|
||||
version = "0.1.66"
|
||||
version = "0.1.67"
|
||||
description = "Reliable and introspectable async CLI action framework."
|
||||
authors = ["Roland Thomas Jr <roland@rtj.dev>"]
|
||||
license = "MIT"
|
||||
|
Reference in New Issue
Block a user