I am running Active Collab 5.8.7 with PHP 5.6. I am using the API to create a Company and User. The API works but if there are any errors, the errors do not bubble up to the calling PHP script. I am using the approach outlined here.
try {
$client->post('projects/65/tasks', [
'name' => 'This is a task name',
'assignee_id' => 48
]);
} catch(AppException $e) {
print $e->getMessage() . '<br><br>';
// var_dump($e->getServerResponse()); (need more info?)
}
The only way I can catch errors is by turning on debugging in Active Collab config.php
and watching the log file. For instance, in the above example, the task_list_id
is missing but it is required. I didn't figure that out until I looked in the log. I would expect that error to bubble up so I can catch it in my script.
Does anyone know how to make these errors bubble up?
Active Collab is pretty "secretive" about debugging info when running in production mode. To have the exact error logged, use debugging mode.
To turn on debug mode, open Active Collab's config/config.php
and add:
const APPLICATION_MODE = 'debug';
in the block where other settings are defined. Note that you might already have APPLICATION_MODE
constant defined in config/config.php
in some cases, so look for it first.