1. drmaa2_lasterror_text(3)
  2. DRMAA2
  3. drmaa2_lasterror_text(3)

NAME

drmaa2_lasterror_text - drmaa2_lasterror_text, Returns the last error occured within the thread.

SYNOPSIS

#include "drmaa2.h"

drmaa2_string drmaa2_lasterror_text(void)

DESCRIPTION

Returns the last DRMAA2 related error happend within the thread the function has called. Internally thread local storage is used by DRMAA2 functions for storing errors. This function is usually called when a previous DRMAA2 function call failed resulting in returning a NULL value. A numerical description of the error can be get by using the drmaa2_lasterror(3) call.

RETURN VALUES

Returns a copy of an unspecified string value describing the last error occurred. If no error happend yet NULL is returned. The drmaa2_string must be freed from the calling function.

EXAMPLE

drmaa2_rsession rs = drmaa2_open_rsession(NULL);

if (rs == NULL) {
   if (drmaa2_listerror() == DRMAA2_UNSUPPORTED_OPERATION) {
      printf("Don't use reservations sessions again, they are not supported.\n");
   } else {
      /* handle real error ... */
      drmaa2_error error = drmaa2_lasterror_text();
      printf("Following error happend while opening a reservation session: %s\n", error);
      drmaa2_string_free(&error);
   }
} else {
   /* Do something with the reservation session ... */
}

SEE ALSO

drmaa2_lasterror(3)

AUTHOR

Copyright Univa Corporation 2013

  1. Univa Corporation
  2. October 2013
  3. drmaa2_lasterror_text(3)