Welcome Guest, Not a member yet? Register   Sign In
whoops page
#1
Exclamation 

Hello,
i use an package from github: https://github.com/fattureincloud/fattur...ud-php-sdk
and i integrate it correctly.. 
my problem is when use it in a specefic conditions my website return the "whoops page" although i use the Exception!
my code is: 
PHP Code:
$config FattureInCloud\Configuration::getDefaultConfiguration()->setAccessToken('tokenvalue');


 
$apiInstance = new FattureInCloud\Api\ClientsApi(
 
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
 // This is optional, `GuzzleHttp\Client` will be used as default.
 
new GuzzleHttp\Client(),
 
$config
 
);
 
$company_id 12345678// int | The ID of the company.

$q 'vat_number=xxxxx'// string | Query for filtering the results.
  
try {
    $result $apiInstance->listClients($company_id$fields$fieldset$sort$page$per_page$q);
    print_r($result);
} catch (
Exception $e) {
    echo 'Exception when calling ClientsApi->listClients: '$e->getMessage(), PHP_EOL;


in error log i see this: 
resulted in a `422 Unprocessable Entity` response:

{"error":{"message":"Invalid query syntax.","validation_result":null}}

My questio is:
How i change the whoops page by the error message returned?! because i not need by script stopped and must continue working with diplayong error message!
thanks..
Reply
#2

Whoops page means there is an uncaught exception.

Catch the exception correctly and do what you want.
Reply
#3

Whoops page will come only on production mode which stops displaying unwonted backend info.
I would recommend switching the environment to development and read the error to sort out the problem.
Reply
#4

On a small guess, I think the namespaces conflict which will give you a HTTP 500, if you put the environment on 'development' you should be able to see this.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB