mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Catching possible account errors (#3596)
Co-authored-by: David Bomba <turbo124@gmail.com>
This commit is contained in:
parent
4323968240
commit
0c7620a381
@ -41,8 +41,16 @@ class AuthService
|
|||||||
$response = Request::post($this->getUrl(), $this->getHeaders(), $body);
|
$response = Request::post($this->getUrl(), $this->getHeaders(), $body);
|
||||||
|
|
||||||
if ($response->code == 200) {
|
if ($response->code == 200) {
|
||||||
|
|
||||||
|
try {
|
||||||
$this->isSuccessful = true;
|
$this->isSuccessful = true;
|
||||||
$this->token = $response->body->data[0]->token->token;
|
$this->token = $response->body->data[0]->token->token;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
info($e->getMessage());
|
||||||
|
|
||||||
|
$this->isSuccessful = false;
|
||||||
|
$this->errors = [trans('texts.migration_went_wrong')];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($response->code, [401, 422, 500])) {
|
if (in_array($response->code, [401, 422, 500])) {
|
||||||
|
@ -3535,6 +3535,7 @@ $LANG = array(
|
|||||||
'marked_credit_as_sent' => 'Successfully marked credit as sent',
|
'marked_credit_as_sent' => 'Successfully marked credit as sent',
|
||||||
'email_subject_payment_partial' => 'Email Partial Payment Subject',
|
'email_subject_payment_partial' => 'Email Partial Payment Subject',
|
||||||
'is_approved' => 'Is Approved',
|
'is_approved' => 'Is Approved',
|
||||||
|
'migration_went_wrong' => 'Oops, something went wrong! Make sure you did proper setup with V2 of Invoice Ninja, before starting migration.',
|
||||||
'cross_migration_message' => 'Cross account migration is not allowed. Please read more about it here: <a href="https://invoiceninja.github.io/cross-site-migration.html">https://invoiceninja.github.io/cross-site-migration.html</a>'
|
'cross_migration_message' => 'Cross account migration is not allowed. Please read more about it here: <a href="https://invoiceninja.github.io/cross-site-migration.html">https://invoiceninja.github.io/cross-site-migration.html</a>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user