You can design and equip the application with error-catching and handling mechanisms, by writing the PB code.
After capturing the error, if you want to know more detailed error information, or deal with some problems caused by other contextual operations, the various logs provided by PowerServer will help. For more, refer to Logs and unsupported features report.