Support the ongoing development of Laravel.io →
posted 10 years ago
Laravel.io
Last updated 2 years ago.
0

I would extract that logic to a new subclass, in that class check if feeds is a bogus value, if it is, throw a new exception. Then in my controller i would check if a FacebookApiException was thrown, if I catch one, the in would redirect with a flash message to inform the user that something went wrong.

This is just a prototype but I would do something like this:

http://laravel.io/bin/KDD

Last updated 2 years ago.
0

Thanks for the quick replay

I would extract that logic to a new subclass, in that class check if feeds is a bogus value

the script dont run up to retrieving the feeds it throwns an ex ....

I would extract that logic to a new subclass

sorry but I don't get your point ... Can you give me a simple example, please ?

Just more information

I'm building up a rest api

Last updated 2 years ago.
0

Oh, if thats a know exception and you are not catching it, chances are you are not using the namespace correctly. You may need something like.

// The namespace route to the exception.
use FacebookApi\FacebookApiException;

at the top of your file.

Last updated 2 years ago.
0

well catch (I've forgot it silly me) but it doesn't still work :(

Last updated 2 years ago.
0

What exactly are you seeing at the whoops screen when the exception is throw, can you paste the full code on a help.laravel.io for us? :D

Last updated 2 years ago.
0

FacebookApiException

Invalid OAuth access token signature.

  • because the access token is no longer valid. If that is
  • the case, then we destroy the session.
  • @param array $result A record storing the error message returned
  • by a failed API call. */ protected function throwAPIException($result) { $e = new FacebookApiException($result); switch ($e->getType()) { // OAuth 2.0 Draft 00 style
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

whisher whisher Joined 9 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.