Php try to get error report

I have an application that relies on a soap server to create content. In addition, site authentication is based on a separate LDAP server. Obviously, if none of them works or does not respond, the site does not work.

I am trying to lay out a design so that I can report errors to site admins, as well as give a nice message to the user in case the site does not work. Error reporting is simply email, inserting a database, or writing to a text file on the PHP server $ _COOKIE, $ _SERVER, $ _SESSION, $ _REQUEST and potentially a SoapFault exception. This information will help me debug any potential problems with the site if they happen.

My site is currently designed as follows:

SoapClientInterface (defines soap functionality)
      / \
       |
       |   implements
       |
Client (the client implementing the interface, try/catch blocks on all soap calls here) 
      / \
       |
       |  extends
       |
 Authorization (asserts soap objects returned from server/ requests going to server 
               are appropriate for the user performing the request) 
      / \
       |
       | extends
       | 
  {all children classes using the soap interface defined on this level} 

:-) Client, catch catch soapfault, , : 1. , ( if/else, , , , .
2. ( , , , Cookier, Server, Session Request .

, , , .

EDIT: - , , . , . , - /, , ? ( , , .)

+3
1

, , . , . , , , , , ( A file_not_found, , , resource_not_available , database_connection_failure , )... , , .

... catch , , -, ( ) , ( ..). ( ), ( ) .

, . , ? ( ) ...

, , , - ( , )... HTTP ( , , " " )...

+1

Source: https://habr.com/ru/post/1759871/


All Articles