Skip to content

Commit

Permalink
TemplatereplacerCalculation: Change exit codes to be in 300 range
Browse files Browse the repository at this point in the history
The exit codes where specified in the 100 range, which is reserved (by
convention) for exit codes defined by the `CalcJob` class. In fact, some
of them even overlapped with existing exit codes defined by `CalcJob`.
There currently is no logic in `aiida-core` that will prevent or at
least warn when existing exit codes get overwritten so this went
unnoticed until now.

Since the plugin is mostly used for internal testing purposes, there
will not be an automated database migration to update existing exit
codes.
  • Loading branch information
sphuber committed Oct 21, 2022
1 parent f984052 commit c0d28ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiida/calculations/templatereplacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,31 @@ def define(cls, spec):
spec.default_output_node = 'output_parameters'

spec.exit_code(
101,
301,
'ERROR_NO_TEMPORARY_RETRIEVED_FOLDER',
invalidates_cache=True,
message='The temporary retrieved folder data node could not be accessed.'
)
spec.exit_code(
105,
305,
'ERROR_NO_OUTPUT_FILE_NAME_DEFINED',
invalidates_cache=True,
message='The `template` input node did not specify the key `output_file_name`.'
)
spec.exit_code(
110,
310,
'ERROR_READING_OUTPUT_FILE',
invalidates_cache=True,
message='The output file could not be read from the retrieved folder.'
)
spec.exit_code(
111,
311,
'ERROR_READING_TEMPORARY_RETRIEVED_FILE',
invalidates_cache=True,
message='A temporary retrieved file could not be read from the temporary retrieved folder.'
)
spec.exit_code(
120, 'ERROR_INVALID_OUTPUT', invalidates_cache=True, message='The output file contains invalid output.'
320, 'ERROR_INVALID_OUTPUT', invalidates_cache=True, message='The output file contains invalid output.'
)

def prepare_for_submission(self, folder):
Expand Down

0 comments on commit c0d28ab

Please sign in to comment.