From: Mark Hubbart Date: 2004-02-29T06:09:21+09:00 Subject: Re: (noob) need help parsing Apache log file On Feb 28, 2004, at 10:24 AM, Koncept wrote: > Mark. One other thing.... > > If the script is run without *sudo* permissions, this is the error > thrown. How do I catch something like this and present a nicer > message to the user? You need to catch the errors. Enclose the error-generating code in a begin..rescue..end statement: begin # error-prone code here rescue warn "You don't have permission to access the log. Try using sudo." exit end -- Just replace the comment with the line (or lines) of code. You'll probably want to do this with the code where you read in the file, and also the two places where you write the data out. For much more detailed information on error catching, refer to the PickAxe Guide[1], "Exceptions, Catch, and Throw". --Mark [1]: http://phrogz.net/ProgrammingRuby/