Changeset 5891


Ignore:
Timestamp:
Sep 29, 2015 10:35:04 AM (9 years ago)
Author:
gah
Message:

surround file opens with catches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4/lang/tcl/scripts/library.tcl

    r5869 r5891  
    7070        }
    7171        set fname [file join $Rappture::installdir lib library.xml]
    72         set fid [::open $fname r]
    73         set info [read $fid]
    74         close $fid
    75 
     72        if { [catch {
     73            set fid [::open $fname r]
     74            set info [read $fid]
     75            close $fid
     76        } errs] != 0 } {
     77            puts stderr "can't open \"$fname\": errs=$errs errorInfo=$errorInfo"
     78        }
    7679        set stdlib [Rappture::LibraryObj ::#auto $info]
    7780        return $stdlib
     
    8285    } else {
    8386        # otherwise, try to open the file and create its LibraryObj
    84         set fid [::open $fname r]
    85         set info [read $fid]
    86         close $fid
     87        if { [catch {
     88            set fid [::open $fname r]
     89            set info [read $fid]
     90            close $fid
     91        } errs] != 0 } {
     92            puts stderr "can't open \"$fname\": errs=$errs errorInfo=$errorInfo"
     93        }
    8794    }
    8895
Note: See TracChangeset for help on using the changeset viewer.