From: Brian Candler Date: 2003-07-07T17:19:26+09:00 Subject: Re: trapping compile time errors On Mon, Jul 07, 2003 at 05:15:45PM +0900, Gerard A.W. Vreeswijk wrote: > I want to catch compile time errors with my own method. ... > Eventually, > I came up with the following, which is not as I imagined. It's ugly. It's correct though - need an 'eval' because you must have a working (syntactically-valid) program A to report the error, before attempting to compile invalid program B. The other way is with require or load: begin require 'somefile.rb' rescue Exception => e puts "Error here (#{e}). May be any error, including SyntaxError" end Regards, Brian.