Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:49:08+00:00 2026-06-06T03:49:08+00:00

This is probably going to sound like a sci-fi request, though – is there

  • 0

This is probably going to sound like a sci-fi request, though – is there a way to return to the beginning of the try {} block where Exception was thrown from within the catch() {} block?

Here is an example:

try
{
    // make OAuth request
}
catch(OAuthException $e)
{
    // if(){}
    // If tells me that the Exception was thrown because the access token is expired
    // I have alternative access token (that's always up to date, but there is a catch why I void using it)
    // I set it as a new access token and want to repeat the try {} block
}

Obviously goto could do it, though, I am looking if there is a more sophisticated approach.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:49:10+00:00Added an answer on June 6, 2026 at 3:49 am

    You can wrap the code up inside a function and call the same function from the catch section

    function remotePost($accessToken){
    
      try{
    
      }catch(OAuthException $e){
      //the one used is not alternative token and if there is an alternative access token
        return remotePost($alternativeAccessToken);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You can probably see where I am going with this - but is there
This probably sounds like a stupid question, but I'm going to give it a
This is probably going to sound backwards. I need for a form to submit
this is probably going to seem like a daft question but please bear with
Well this is going to sound like a lame question, I know. This is
I'm probably going about this the wrong way, but here goes: I am starting
This is probably going to be a really simple fix... I just can't figure
This is probably going to be an easy thing but I am having a
This probably sounds like a terrible idea at first glance, but here is my
This is probably going to be more of a discussion or hypothetical question, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.