// Breakdown functions for unhandled error:
class Breakdown
{
   static HandlePageError( message: string, url: string, line: number, col: number,
                           errorObj ): boolean {
      let errorText = message ?
         'Error on web-page.' :
         'Undefinite error on web-page.'
      if (url)
         errorText += '\nURL: '+url
/*
      if (line)
         errorText += '\nLine: '+line
*/
      let errorObjectAdded = false
      if (errorObj)
      {
         try {
            errorText += '\n\n'+errorObj
            errorObjectAdded = true
         } catch {}
      }
      if ( message && !errorObjectAdded )
         errorText += '\n\n'+message;
      let reloadPage = page_loaded && App.IsReleaseConfiguration()
      let leavePageForDebug = !reloadPage
      errorText += leavePageForDebug ?
         '\n\nSee error details in browser debug console.'+
         '\n(Further app.functioning may be incorrect; reload the page maually.)'
         : '\n\nThe page will be reloaded.'
      alert(errorText)
      if ( reloadPage )
         window.location.href = "" // reload from root
      return false // show default error output (with correct line-no)
   }
} // Breakdown
