Skip to content

Commit 631f2ec

Browse files
committed
changed to always return the layout name as part of the error message for easier debugging
1 parent 4d556fb commit 631f2ec

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Services/FileMakerConnection.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ protected function checkResponseForErrors($response): void
164164
$code = (int) $message['code'];
165165

166166
if ($code !== 0) {
167-
switch ($code) {
168-
case 105:
169-
// Layout is missing error
170-
// Add the layout name to the message for clarity
171-
$message = $message['message'] . ': ' . $this->getLayout();
172-
throw new FileMakerDataApiException($message, $code);
173-
default:
174-
throw new FileMakerDataApiException($message['message'], $code);
167+
168+
// If the layout is not the same as the table prefix, a layout has been specified and we
169+
// should to add the layout name for clarity
170+
if ($this->layout) {
171+
$customMessage = 'Layout: ' . $this->getLayout() . ' - ' . $message['message'];
172+
} else {
173+
$customMessage = $message['message'];
175174
}
175+
throw new FileMakerDataApiException($customMessage, $code);
176176
}
177177
}
178178
} else {

0 commit comments

Comments
 (0)