@@ -248,11 +248,11 @@ ;; (define (common:rotate-logs) (if (not (directory-exists? "logs"))(create-directory "logs")) (directory-fold (lambda (file rem) - (handle-exceptions + (common:debug-handle-exceptions #t exn (debug:print-info 0 *default-log-port* "failed to rotate log " file ", probably handled by another process.") (let* ((fullname (conc "logs/" file)) (file-age (- (current-seconds)(file-modification-time fullname)))) (if (or (and (string-match "^.*.log" file) @@ -291,11 +291,11 @@ (cond ((get-environment-variable "MT_SKIP_DB_MIGRATE") #t) ((and (file-exists? mtconf) (file-exists? dbfile) (not read-only) (eq? (current-user-id)(file-owner mtconf))) ;; safe to run -cleanup-db (debug:print 0 *default-log-port* " I see you are the owner of megatest.config, attempting to cleanup and reset to new version") - (handle-exceptions + (common:debug-handle-exceptions #t exn (begin (debug:print 0 *default-log-port* "Failed to switch versions.") (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) (print-call-chain (current-error-port)) @@ -397,13 +397,13 @@ (define (common:get-megatest-exe) (or (getenv "MT_MEGATEST") "megatest")) (define (common:read-encoded-string instr) - (handle-exceptions + (common:debug-handle-exceptions #t exn - (handle-exceptions + (common:debug-handle-exceptions #t exn (begin (debug:print-error 0 *default-log-port* "received bad encoded string \"" instr "\", message: " ((condition-property-accessor 'exn 'message) exn)) (print-call-chain (current-error-port)) #f) @@ -840,11 +840,11 @@ (loop (car tal)(cdr tal)))))))) (define (common:get-install-area) (let ((exe-path (car (argv)))) (if (file-exists? exe-path) - (handle-exceptions + (common:debug-handle-exceptions #t exn #f (pathname-directory (pathname-directory (pathname-directory exe-path)))) @@ -858,11 +858,11 @@ (let loop ((hed (car dirs)) (tal (cdr dirs))) (let ((res (or (and (directory? hed) (file-write-access? hed) hed) - (handle-exceptions + (common:debug-handle-exceptions #t exn #f (create-directory hed #t))))) (if (and (string? res) (directory? res)) @@ -874,18 +874,18 @@ ;; return the youngest timestamp . filename ;; (define (common:get-youngest glob-list) (let ((all-files (apply append (map (lambda (patt) - (handle-exceptions + (common:debug-handle-exceptions #t exn '() (glob patt))) glob-list)))) (fold (lambda (fname res) (let ((last-mod (car res)) - (curmod (handle-exceptions + (curmod (common:debug-handle-exceptions #t exn 0 (file-modification-time fname)))) (if (> curmod last-mod) (list curmod fname) @@ -1202,23 +1202,23 @@ ;; lazy-safe get file mod time. on any error (file not existing etc.) return 0 ;; (define (common:lazy-modification-time fpath) (handle-exceptions - exn - 0 - (file-modification-time fpath))) + exn + 0 + (file-modification-time fpath))) ;; find timestamp of newest file associated with a sqlite db file (define (common:lazy-sqlite-db-modification-time fpath) (let* ((glob-list (handle-exceptions - exn - '("/no/such/file") - (glob (conc fpath "*")))) + exn + `(,(conc "/no/such/file, message: " ((condition-property-accessor 'exn 'message) exn))) + (glob (conc fpath "*")))) (file-list (if (eq? 0 (length glob-list)) - '("/no/such/file") - glob-list))) + '("/no/such/file") + glob-list))) (apply max (map common:lazy-modification-time file-list)))) @@ -1233,11 +1233,11 @@ ;; make "nice-path" available in config files and the repl (define nice-path common:nice-path) (define (common:read-link-f path) - (handle-exceptions + (common:debug-handle-exceptions #t exn (begin (debug:print-error 0 *default-log-port* "command \"/bin/readlink -f " path "\" failed.") path) ;; just give up (with-input-from-pipe