io-condition.scm 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ;; SRFI 36
  3. (define-condition-type &i/o-error &error
  4. i/o-error?)
  5. (define-condition-type &i/o-port-error &i/o-error
  6. i/o-port-error?
  7. (port i/o-error-port))
  8. (define-condition-type &i/o-read-error &i/o-port-error
  9. i/o-read-error?)
  10. (define-condition-type &i/o-write-error &i/o-port-error
  11. i/o-write-error?)
  12. (define-condition-type &i/o-closed-error &i/o-port-error
  13. i/o-closed-error?)
  14. (define-condition-type &i/o-filename-error &i/o-error
  15. i/o-filename-error?
  16. (filename i/o-error-filename))
  17. (define-condition-type &i/o-malformed-filename-error &i/o-filename-error
  18. i/o-malformed-filename-error?)
  19. (define-condition-type &i/o-file-protection-error &i/o-filename-error
  20. i/o-file-protection-error?)
  21. (define-condition-type &i/o-file-is-read-only-error &i/o-file-protection-error
  22. i/o-file-is-read-only-error?)
  23. (define-condition-type &i/o-file-already-exists-error &i/o-filename-error
  24. i/o-file-already-exists-error?)
  25. (define-condition-type &i/o-no-such-file-error &i/o-filename-error
  26. i/o-no-such-file-error?)
  27. (define-condition-type &read-error &error
  28. read-error?
  29. (line read-error-line)
  30. (column read-error-column)
  31. (position read-error-position)
  32. (span read-error-span))
  33. ; Local additions
  34. (define-condition-type &primitive-i/o-error &i/o-error
  35. primitive-i/o-error?
  36. (status i/o-error-status)
  37. (operation i/o-error-operation)
  38. (arguments i/o-error-arguments))