drmaa2_lasterror_text
- drmaa2_lasterror_text, Returns the last error occured within the thread.
#include "drmaa2.h"
drmaa2_string drmaa2_lasterror_text(void)
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.
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.
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 ... */
}
Copyright Univa Corporation 2013