[H5] Survive bad recent games query

parent c4520b12
Pipeline #877 passed with stages
in 3 minutes and 28 seconds
......@@ -74,6 +74,7 @@ class ProfileController extends Controller
try {
$account = Account::with('h5', 'h5.warzone')
->where('seo', Text::seoGamertag($gamertag))
->where('accountType', Console::Xbox)
->firstOrFail();
// We don't care about non-panda members
......@@ -174,11 +175,22 @@ class ProfileController extends Controller
'page' => $page,
])->render();
} catch (ModelNotFoundException $e) {
return \Response::json(['false']);
return view('includes.message', [
'message' => [
'header' => 'Uh oh',
'type' => 'red',
'body' => 'We encountered a major error and could not recover :('
]
]);
} catch (ClientException $ex) {
$this->dispatch(new UpdateHalo5Account($account));
return \Response::json(['false']);
return view('includes.message', [
'message' => [
'header' => 'Uh oh',
'type' => 'red',
'body' => 'We encountered a major error and could not recover :('
]
]);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment