more error-message conversions and repairs
original commit: a137459b65b54d65595e854101aae7440d9e65f6
This commit is contained in:
parent
c40abf9b9f
commit
0f2664cdd9
|
@ -236,7 +236,7 @@
|
||||||
|
|
||||||
(define (namespace-defined? n)
|
(define (namespace-defined? n)
|
||||||
(unless (symbol? n)
|
(unless (symbol? n)
|
||||||
(raise-type-error 'namespace-defined? "symbol" n))
|
(raise-argument-error 'namespace-defined? "symbol?" n))
|
||||||
(not (eq? (namespace-variable-value n #t (lambda () ns-undefined))
|
(not (eq? (namespace-variable-value n #t (lambda () ns-undefined))
|
||||||
ns-undefined)))
|
ns-undefined)))
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@
|
||||||
[(a b) (merge-input a b 4096)]
|
[(a b) (merge-input a b 4096)]
|
||||||
[(a b limit)
|
[(a b limit)
|
||||||
(or (input-port? a)
|
(or (input-port? a)
|
||||||
(raise-type-error 'merge-input "input-port" a))
|
(raise-argument-error 'merge-input "input-port?" a))
|
||||||
(or (input-port? b)
|
(or (input-port? b)
|
||||||
(raise-type-error 'merge-input "input-port" b))
|
(raise-argument-error 'merge-input "input-port?" b))
|
||||||
(or (not limit)
|
(or (not limit)
|
||||||
(and (number? limit) (positive? limit) (exact? limit) (integer? limit))
|
(and (number? limit) (positive? limit) (exact? limit) (integer? limit))
|
||||||
(raise-type-error 'merge-input "positive exact integer or #f" limit))
|
(raise-argument-error 'merge-input "(or/c exact-positive-integer #f)" limit))
|
||||||
(let-values ([(rd wt) (make-pipe-with-specials limit)]
|
(let-values ([(rd wt) (make-pipe-with-specials limit)]
|
||||||
[(other-done?) #f]
|
[(other-done?) #f]
|
||||||
[(sema) (make-semaphore 1)])
|
[(sema) (make-semaphore 1)])
|
||||||
|
@ -898,10 +898,10 @@
|
||||||
(define special-filter-input-port
|
(define special-filter-input-port
|
||||||
(lambda (p filter [close? #t])
|
(lambda (p filter [close? #t])
|
||||||
(unless (input-port? p)
|
(unless (input-port? p)
|
||||||
(raise-type-error 'special-filter-input-port "input port" p))
|
(raise-argument-error 'special-filter-input-port "input-port?" p))
|
||||||
(unless (and (procedure? filter)
|
(unless (and (procedure? filter)
|
||||||
(procedure-arity-includes? filter 2))
|
(procedure-arity-includes? filter 2))
|
||||||
(raise-type-error 'special-filter-input-port "procedure (arity 2)" filter))
|
(raise-argument-error 'special-filter-input-port "(any/c bytes? . -> . any/c)" filter))
|
||||||
(make-input-port
|
(make-input-port
|
||||||
(object-name p)
|
(object-name p)
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
[(string? pattern) (pregexp pattern)]
|
[(string? pattern) (pregexp pattern)]
|
||||||
[(regexp? pattern) pattern]
|
[(regexp? pattern) pattern]
|
||||||
[(byte-regexp? pattern) pattern]
|
[(byte-regexp? pattern) pattern]
|
||||||
[else (raise-type-error who "regexp, byte-regexp, string, or byte string"
|
[else (raise-argument-error who "(or/c regexp? byte-regexp? string? bytes?)"
|
||||||
pattern)]))
|
pattern)]))
|
||||||
|
|
||||||
(define/kw (pregexp-match pattern input #:optional [start-k 0] [end-k #f] [output-port #f])
|
(define/kw (pregexp-match pattern input #:optional [start-k 0] [end-k #f] [output-port #f])
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
(define (check-exe who exe)
|
(define (check-exe who exe)
|
||||||
(unless (path-string? exe)
|
(unless (path-string? exe)
|
||||||
(raise-type-error who "path or string" exe))
|
(raise-argument-error who "path-string?" exe))
|
||||||
exe)
|
exe)
|
||||||
|
|
||||||
(define (path-or-ok-string? s)
|
(define (path-or-ok-string? s)
|
||||||
|
@ -75,14 +75,21 @@
|
||||||
(for ([s (in-list args)])
|
(for ([s (in-list args)])
|
||||||
(unless (or (path-or-ok-string? s)
|
(unless (or (path-or-ok-string? s)
|
||||||
(bytes-no-nuls? s))
|
(bytes-no-nuls? s))
|
||||||
(raise-type-error who "path, string, or byte string (without nuls)"
|
(raise-argument-error
|
||||||
|
who
|
||||||
|
(string-append "(or/c path-string?\n"
|
||||||
|
" (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))")
|
||||||
s)))])
|
s)))])
|
||||||
args)
|
args)
|
||||||
|
|
||||||
(define (check-command who str)
|
(define (check-command who str)
|
||||||
(unless (or (string-no-nuls? str)
|
(unless (or (string-no-nuls? str)
|
||||||
(bytes-no-nuls? str))
|
(bytes-no-nuls? str))
|
||||||
(raise-type-error who "string or byte string (without nuls)" str)))
|
(raise-argument-error
|
||||||
|
who
|
||||||
|
(string-append "(or/c (and/c string? (lambda (s) (not (memv #\\nul (string->list s)))))\n"
|
||||||
|
" (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))")
|
||||||
|
str)))
|
||||||
|
|
||||||
;; Old-style functions: ----------------------------------------
|
;; Old-style functions: ----------------------------------------
|
||||||
|
|
||||||
|
@ -131,9 +138,9 @@
|
||||||
(twait se))]
|
(twait se))]
|
||||||
[(interrupt) (subprocess-kill subp #f)]
|
[(interrupt) (subprocess-kill subp #f)]
|
||||||
[(kill) (subprocess-kill subp #t)]
|
[(kill) (subprocess-kill subp #t)]
|
||||||
[else (raise-type-error
|
[else (raise-argument-error
|
||||||
'control-process
|
'control-process
|
||||||
"'status, 'exit-code, 'wait, 'interrupt, or 'kill" m)]))
|
"(or/c 'status 'exit-code 'wait 'interrupt 'kill)" m)]))
|
||||||
(list (aport so)
|
(list (aport so)
|
||||||
(aport si)
|
(aport si)
|
||||||
(subprocess-pid subp)
|
(subprocess-pid subp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user