Skip to content

Commit 169a600

Browse files
committed
Replaced all drupal error pages with a custom error block.
1 parent 590ff2f commit 169a600

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

os2web_cp_service.module

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function os2web_gf_service_handler($file_id) {
124124
}
125125
else {
126126

127-
// Show a polite message if the file cant be downloaded.
127+
// Show a polite message if the file isnt allowed for download.
128128
// If the message isnt set in config, deliver a access denied page.
129129
if ($error_message = variable_get('os2web_cp_service_access_denied_message')) {
130130
$markup = '<div class="messages error"><ul><li>';
@@ -137,26 +137,28 @@ function os2web_gf_service_handler($file_id) {
137137
);
138138
return $page;
139139
}
140-
else {
141-
drupal_access_denied();
142-
}
143140
}
144141
}
145-
else {
146-
error_log(basename(__FILE__) . ':' . __LINE__ . ' HTTP header recieved = ' . print_r($header, 1));
147-
drupal_not_found();
148-
}
149142
}
150143
else {
151144
error_log(basename(__FILE__) . ':' . __LINE__ . ' Settings are wrong.');
152-
drupal_not_found();
153145
}
154146

155147
}
156148
else {
157149
error_log(basename(__FILE__) . ':' . __LINE__ . ' No URL found in variable DB');
158-
drupal_not_found();
159150
}
151+
152+
// If we come to this line, show an error.
153+
$markup = '<div class="messages error"><ul><li>';
154+
$markup .= t('Det ønskede dokument kunne ikke hentes, hvilket kan skyldes opdatering af løsningen. Prøv venligst igen senere.');
155+
$markup .= '</li></ul></div>';
156+
157+
$page['region'] = array(
158+
'#type' => 'markup',
159+
'#markup' => $markup,
160+
);
161+
return $page;
160162
}
161163

162164
/**

0 commit comments

Comments
 (0)