NubladoClientSlackException#

exception rubin.nublado.client.NubladoClientSlackException(msg, user=None, *, started_at=None, failed_at=None)#

Bases: SlackException

Represents an exception that can be reported to Slack or Sentry.

This adds some additional fields to SlackException but is otherwise equivalent. It is intended to be subclassed. Subclasses must override the to_slack and to_sentry methods.

Parameters:
  • msg (str) – Exception message.

  • user (str | None, default: None) – User mobu was operating as when the exception happened.

  • started_at (datetime | None, default: None) – When the operation started.

  • failed_at (datetime | None, default: None) – When the operation failed (defaults to the current time).

started_at#

When the operation that ended in an exception started.

annotations#

Additional annotations.

common_blocks()#

Return common blocks to put in any alert.

Returns:

Common blocks to add to the Slack message.

Return type:

list of safir.slack.blockkit.SlackBaseBlock

common_fields()#

Return common fields to put in any alert.

Returns:

Common fields to add to the Slack message.

Return type:

list of safir.slack.blockkit.SlackBaseField

to_sentry()#

Return an object with tags and contexts to add to Sentry events.

Returns:

Annotated Sentry object.

Return type:

SentryEventInfo

to_slack()#

Format the error as a Slack Block Kit message.

Returns:

Formatted Slack message.

Return type:

SlackMessage