web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Detecting Specific Err...
Power Apps
Suggested Answer

Detecting Specific Errors in App.Start

(1) ShareShare
ReportReport
Posted on by 278
Good Morning,
 
I have an app and I run a flow in the App.start method.
 
I want to be able to detect specific errors, not just that an error has occurred.
 
Specifically, ReponseTimeout and also when the flow is turned off.
 
I can certainly detect that an error has occurred but I cannot find code/examples for getting more specific.
 
Has anyone figure out how to do this?
 
Thanks
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,369 Super User 2025 Season 2 on at
    Hi,
     
    FIRST: Do not do what you are doing, please, please, please, please DO NOT. And now I will answer you.
     
    You are not going to always get nice specific errors. 
     
    Firstly, an error that YOU catch in the Flow, allows you to pass back the information (as long as you catch it IN the flow) to the caller, however you want.
     
    However, when an error occurs that is outside the scope of the Flow, you get back what the Platform Decides.
     
    My recommendation is to do this.
     
    1. If you do NOT add an error handler into your code, you MUST add one in the OnError of the App. Its a property like OnAppStart
     
    Any errors NOT caught, end up here, if you don't handle them here, it's the Pink Ugg of Doom Message that people get
    So you would have to look up the error codes you think you will get, handle the ones  YOU pass back into the OnStart,
    For anything you cannot handle rethrow it to the OnError
    And have codd there to do something with it.
     
    LASTLY: DO NOT DO WHAT YOU ARE DOING
     
    If you want to do what you are doing please change it to this.
     
    1. Create a Full Form Blocking Window, that is opaque (just a square)
    2. Add a Spinner (download one, buy one, build one, its all easy)
    3. Group these two things together and make sure the Spinner is on top
    4. In your OnVisible, FIRST make these 2 things Visible, with the spinner saying something like Please Wait XYZ
    5. Then call your Flow
    6. Do whatever you are going to do with the Error and App.
     
     
  • IAmIntractable Profile Picture
    278 on at
    Good Morning FLMike,
     
    Thank you for your response.
     
    You have made the correct distinction that the errors I am trying to detect are app generated and not from the flow. 
     
    That said, I am not clear what you are warning me not to do since I have not said anything more than wanting to detect and react to app errors thrown by a call to a flow (which seems like a ridiculous platform oversight). Can you provide some insight?
     
    You also seem to suggest that calling a flow from the App.Start is wrong. Why? I actually call the flow from app.start and do so in a way that forces the call to finish before the app.start continues to execute. I understand that this might make the app look like it's doing nothing but that is why I have a start screen and have added code to it to do nothing until the app.start is complete. The flow executes in < 1 second and this approach has worked flawlessly. Now I just want to handle some situations that have surfaced due to a recent Microsoft Platform failure. I also understand the OnError method but I am not clear (because there is no documentation) how an app processes this method and if it actually goes back to the point of error as you implied by "YOU pass back into the OnStart".
     
    I am simply looking for a code segment that might make it easy identify the app generated errors so I can react to them. There actually is a finite list of these situations that Microsoft has outlined in one of its pages. This is not an unreasonable expectation and shockingly one the platform seems to think is unnecessary.
     
    Thanks
  • IAmIntractable Profile Picture
    278 on at
    Was hoping a pro level person might have a solution?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard