Skip to content

Commit

Permalink
Raise these so that we get the full picture on failure and can decide…
Browse files Browse the repository at this point in the history
… what to do in dynamodb_state_store
  • Loading branch information
KaspariK committed Oct 25, 2024
1 parent df6614b commit e4caf72
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tron/actioncommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ def to_json(state_data: dict) -> Optional[str]:
)
except KeyError:
log.exception("Missing key in state_data:")
return None
raise
except Exception:
log.exception("Error serializing SubprocessActionRunnerFactory to JSON:")
return None
raise


def create_action_runner_factory_from_config(config):
Expand Down
4 changes: 2 additions & 2 deletions tron/core/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ def serialize_namedtuple(obj):
)
except KeyError:
log.exception("Missing key in state_data:")
return None
raise
except Exception:
log.exception("Error serializing ActionCommandConfig to JSON:")
return None
raise


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions tron/core/actionrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ def to_json(state_data: dict) -> Optional[str]:
)
except KeyError:
log.exception("Missing key in state_data:")
return None
raise
except Exception:
log.exception("Error serializing ActionRunAttempt to JSON:")
return None
raise

@classmethod
def from_state(cls, state_data):
Expand Down Expand Up @@ -770,10 +770,10 @@ def to_json(state_data: dict) -> Optional[str]:
)
except KeyError:
log.exception("Missing key in state_data:")
return None
raise
except Exception:
log.exception("Error serializing ActionRun to JSON:")
return None
raise

def render_template(self, template):
"""Render our configured command using the command context."""
Expand Down
2 changes: 1 addition & 1 deletion tron/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def to_json(state_data: dict) -> Optional[str]:
return json.dumps(state_data)
except Exception:
log.exception("Error serializing Job to JSON:")
return None
raise

@classmethod
def from_config(
Expand Down
4 changes: 2 additions & 2 deletions tron/core/jobrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ def to_json(state_data: dict) -> Optional[str]:
)
except KeyError:
log.exception("Missing key in state_data:")
return None
raise
except Exception:
log.exception("Error serializing JobRun to JSON:")
return None
raise

@property
def id(self):
Expand Down

0 comments on commit e4caf72

Please sign in to comment.