Skip to content
Snippets Groups Projects
messages.py 3.19 KiB
Newer Older
class Errors:
    REQUEST_FAILED = "FAILED: request could not be parsed, please contact det-support@xfel.eu"
    RUN_SKIPPED = "WARN: run at {} is marked to be skipped for calibration."
Steffen Hauf's avatar
Steffen Hauf committed
    REQUEST_MALFORMED = "FAILED: request {} is malformed, please contact det-support@xfel.eu"
    UNKNOWN_ACTION = "FAILED: action {} is not known!, please contact det-support@xfel.eu"
    PATH_NOT_FOUND = "FAILED: run at {} not found!, please contact det-support@xfel.eu"
    NOTHING_TO_DO = "WARN: nothing to calibrate in path {}, please contact det-support@xfel.eu"
    CONFIG_ERROR = "FAILED: configuration at {} couldn't be parsed, using default!, please contact det-support@xfel.eu"
    CONFIG_NOT_FOUND = "WARN: configuration at {} not found, using default!, please contact det-support@xfel.eu"
    NO_DEFAULT_CONFIG = "FAILED: No default config for instrument {}, detector {} exists!, please contact det-support@xfel.eu"
    JOB_LAUNCH_FAILED = "FAILED: Failed executing command: {}, code: {}, please contact det-support@xfel.eu"
    UPLOAD_CONFIG_FAILED = "FAILED: Config for cycle {}, proposal {} could not be uploaded!, please contact det-support@xfel.eu"
    TRANSFER_EVAL_FAILED = "FAILED: Evaluating transfer to offline failed for proposal {}, run {}, please contact it-support@xfel.eu"
Steffen Hauf's avatar
Steffen Hauf committed
    MDC_RESPONSE = "FAILED: Response error from MDC: {}"
Steffen Hauf's avatar
Steffen Hauf committed
    NOT_CONFIGURED = "FAILED: instrument not configured, please contact det-support@xfel.eu"
    NOT_SUBMITTED = "FAILED: correction of {} failed during submision, please contact det-support@xfel.eu"
Thomas Kluyver's avatar
Thomas Kluyver committed
    OTHER_ERROR = "FAILED: Error {}, please contact det-support@xfel.eu"
class MigrationError(Exception):

    @classmethod
    def timeout(cls, run: int, proposal: int, time: str):
            f"FAILED: migration issue for proposal {proposal} run `{run}`: "
            f"migration still incompleted after {time}, "
            "manually restarting migration may help"
class MDC:
    MIGRATION_TIMEOUT = "Timeout waiting for migration. Contact it-support@xfel.eu"
    NOTHING_TO_DO = "Nothing to calibrate for this run, copied raw data only"


class PDUsNotFoundError(Exception):
    """Exception raised when a detector cannot be found."""
    pass


class OperationModeNotFoundError(Exception):
    """Exception raised when an operation mode cannot be found for a given detector."""
    pass


class Success:
    UPLOADED_CONFIG = "SUCCESS: Uploaded config for cycle {}, proposal {}"
Steffen Hauf's avatar
Steffen Hauf committed
    START_CORRECTION = "SUCCESS: Started correction: proposal {}, run {}"
    START_CHAR = "SUCCESS: Started dark characterization: proposal {}, run {}"
    START_CORRECTION_SIM = "SUCCESS: Simulated, not submitting jobs. Would do correction: proposal {}, run {}"
    START_CHAR_SIM = "SUCCESS: Simulated, not submitting jobs. Would do dark characterization: proposal {}, run {}"
    QUEUED = "SUCCESS: Queued proposal {}, run {} for offline calibration"
    REPROD_QUEUED = "SUCCESS: Queued proposal {}, run {} for reproducing previous offline calibration"
    DONE_CORRECTION = "SUCCESS: Finished correction: proposal {}. run {}"
    DONE_CHAR = "SUCCESS: Finished dark characterization: proposal {}, run {}"
    ALREADY_REQUESTED = "SUCCESS: Correction already queued/running for proposal {}, run {}"