diff options
Diffstat (limited to 'drmaa/v1/low.scm')
-rw-r--r-- | drmaa/v1/low.scm | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drmaa/v1/low.scm b/drmaa/v1/low.scm index 3003052..55d699e 100644 --- a/drmaa/v1/low.scm +++ b/drmaa/v1/low.scm @@ -262,16 +262,23 @@ not be affected by this." #true error-message))) -(define (set-attribute! template name value) - (let ((error-message - (make-char* (bytevector->pointer - (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))) - (return (drmaa_set_attribute template - (string->pointer name) value - error-message - (DRMAA 'ERROR_STRING_BUFFER)) - #true - error-message))) +(define set-attribute! + (let ((valid (get-attribute-names))) + (lambda (template name value) + (unless (member name valid) + (raise (condition + (&formatted-message + (format "This DRMAA implementation does not support the attribute `~a'.~%") + (arguments (list name)))))) + (let ((error-message + (make-char* (bytevector->pointer + (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))) + (return (drmaa_set_attribute template + (string->pointer name) value + error-message + (DRMAA 'ERROR_STRING_BUFFER)) + #true + error-message))))) (define (get-attribute template name) (let ((error-message |