Skip to content

Commit 9cc0aa8

Browse files
committed
Handle some more specific ehrQL exit codes
See: * opensafely-core/ehrql#2543
1 parent 6c678f2 commit 9cc0aa8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

controller/config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,18 @@ def parse_job_resource_weights(config_file_template):
138138
# Map known exit codes to user-friendly messages
139139
DATABASE_EXIT_CODES = {
140140
# Custom database-related exit codes return from ehrQL, see e.g.
141-
# https://github.com/opensafely-core/ehrql/blob/main/ehrql/backends/tpp.py#L159-L171
141+
# https://github.com/opensafely-core/ehrql/blob/889dcfd9762b/ehrql/backends/tpp.py#L159-L171
142142
3: (
143143
"A transient database error occurred, your job may run "
144144
"if you try it again, if it keeps failing then contact tech support"
145145
),
146146
4: "New data is being imported into the database, please try again in a few hours",
147147
5: "Something went wrong with the database, please contact tech support",
148+
# Other ehrQL exit codes with specific meanings, see:
149+
# https://github.com/opensafely-core/ehrql/blob/e0c47acdb887/ehrql/__main__.py#L123-L134
150+
10: "There was a problem reading your ehrQL code; please confirm that it runs locally",
151+
11: "There was a problem reading one of the supplied data files",
152+
12: "You do not have the required permissions for the ehrQL you are trying to run",
148153
}
149154

150155

0 commit comments

Comments
 (0)