code: def close_database_session(session):
      
  
      try:
          session.close()
      except OperationalError as e:
          raise DatabaseError(error=e.orig.args[1], code=e.orig.args[0])
docs: Close connection with the database