Skip to content

Commit 58007df

Browse files
committed
Replace Pre-Mezzanine TRY => TRAP
Something not caught by the tests: usages of TRY prior to its now-mezzanine declaration. Switched to TRAP.
1 parent 28c7722 commit 58007df

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/mezz/base-files.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ make-dir: func [
115115
foreach dir dirs [
116116
path: either empty? path [dir][path/:dir]
117117
append path slash
118-
if error? try [make-dir path] [
118+
if error? trap [make-dir path] [
119119
foreach dir created [attempt [delete dir]]
120120
cause-error 'access 'cannot-open path
121121
]

src/mezz/mezz-help.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ dump-obj: function [
239239
; Get value (may be a function, so handle with ":")
240240
either path? :word [
241241
if any [
242-
error? set/any 'value try [get :word] ;try reduce [to-get-path word]
242+
error? set/any 'value trap [get :word] ;trap reduce [to-get-path word]
243243
not value? 'value
244244
][
245245
print ["No information on" word "(path has no value)"]
@@ -426,7 +426,7 @@ upgrade: function [
426426
"Check for newer versions (update REBOL)."
427427
][
428428
print "Fetching upgrade check ..."
429-
if error? err: try [do http://www.atronixengineering.com/r3/upgrade.r none][
429+
if error? err: trap [do http://www.atronixengineering.com/r3/upgrade.r none][
430430
either err/id = 'protocol [print "Cannot upgrade from web."][do err]
431431
]
432432
exit
@@ -461,7 +461,7 @@ why?: func [
461461
; "Run R3 demo."
462462
;][
463463
; print "Fetching demo..."
464-
; if error? err: try [do http://www.atronixengineering.com/r3/demo.r none][
464+
; if error? err: trap [do http://www.atronixengineering.com/r3/demo.r none][
465465
; either err/id = 'protocol [print "Cannot load demo from web."][do err]
466466
; ]
467467
; exit
@@ -471,7 +471,7 @@ why?: func [
471471
; "Download current Spahirion's R3-GUI module from web."
472472
;][
473473
; print "Fetching GUI..."
474-
; either error? data: try [load http://www.atronixengineering.com/r3/r3-gui.r3] [
474+
; either error? data: trap [load http://www.atronixengineering.com/r3/r3-gui.r3] [
475475
; either data/id = 'protocol [print "Cannot load GUI from web."] [do err]
476476
; ] [
477477
; do data

src/mezz/sys-ports.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ init-schemes: func [
304304
if url? port/spec/ref [
305305
parse port/spec/ref
306306
[thru #":" 0 2 slash copy path [to slash | end] skip copy speed to end]
307-
if speed: try [to integer! speed] [port/spec/speed: speed]
307+
if speed: trap [to integer! speed] [port/spec/speed: speed]
308308
port/spec/path: to file! path
309309
]
310310
]

0 commit comments

Comments
 (0)