6. Error handling and debugging - matteoparlato/Plucky-Phoenix GitHub Wiki

Error handling and debugging WIP

Live monitor

The monitor in Power Apps is a powerful tool for debugging and optimizing applications. It allows you to observe in real-time all the actions performed by your app, including:

  • Events (such as user actions, function calls, and calculations).
  • Dataverse and API calls (queries, responses, execution times, and potential errors).
  • Performance data

The monitor is located under the Advanced tools menu:

image

Events

image

image

image

image

Browser developer tools

image

IfError, IsError, IsBlankOrError

App.OnError

Set( HttpErrorJSON, ParseJSON(FirstError.Details.HttpResponse) ); Set( GlobalErrorDialogVisible, true ); Set( ControlsDisabled, false ); Set( GlobalErrorDialogDisplayProperties, { Action: FirstError.Source, Title: Coalesce( AppCaptions.ErrorActionTitle, "Error" ), Message: With( {HttpErrorJSONMessageTemp: Text(HttpErrorJSON.error.message)}, If( !IsBlank(HttpErrorJSONMessageTemp), HttpErrorJSONMessageTemp, FirstError.Message ) ), Warning: "", Image: Dummy, BackgroundImage: If( AppThemeScheme.DarkThemeScheme, Alert_Dark, Alert_Light ), SeparatorHeight: 2, SeparatorColor: AppThemeScheme.WarningColor, CancelVisible: false, OkVisible: true, CancelCaption: Coalesce( AppCaptions.Cancel, "Cancel" ), OkCaption: Coalesce( AppCaptions.Ok, "Ok" ), Fullscreen: false } ); Set( GlobalErrorNotificationDialogDisplayProperties, { Type: 3, Message: With( {HttpErrorJSONMessageTemp: Text(HttpErrorJSON.error.message)}, If( !IsBlank(HttpErrorJSONMessageTemp), HttpErrorJSONMessageTemp, FirstError.Message ) ), Context: FirstError.Source, Dismissable: true, DismissIcon: Switch( true, FirstError.Source in [ "DocumentLineSelectionScreen_PostDataEntryTrigger.OnSelect.DataEntry.Error", "DocumentLineSelectionScreen_PostDataEntryTrigger.OnSelect.PostSource.Warning", "DocumentLineSelectionScreen_PostDataEntryTrigger.OnSelect.PostSource.Error", "DocumentLineSelectionScreen_SaveAndPostDataEntryTrigger.OnSelect" ], Icon.ArrowRight, Icon.Cancel ) } )

Debug published app

image

Known issues

Monitor of published apps with PCF Controls might not work as expected. Use browser developer tools instead.

FAQ

N/A