code: def check_error(status):
      
      global ERROR_MSG_LST
      if status != 1:
          if len(ERROR_MSG_LST) > 0:
              # clear out the existing error message so that we don't pick up
              # a bad one next time around.
              msg = '\n'.join(ERROR_MSG_LST)
              ERROR_MSG_LST = []
              raise OpenJPEGLibraryError(msg)
          else:
              raise OpenJPEGLibraryError("OpenJPEG function failure.")
docs: Set a generic function as the restype attribute of all OpenJPEG
      functions that return a BOOL_TYPE value.  This way we do not have to check
      for error status in each wrapping function and an exception will always be
      appropriately raised.