[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

I cannot get rescue to work

Xeno Campanoli

6/7/2005 11:02:00 PM

The example on page 108 of pickaxe gives me the following syntax error, for
instance:

../try4.rb:11: syntax error
rescue SystemCallError
^
xeno@linux:~/study/data>

Presumably there is something simple I'm doing wrong. Please make a
suggestion, as I'm really stuck.

xc
39 Answers

Assaph Mehr

6/8/2005 12:13:00 AM

0


Xeno Campanoli wrote:
> The example on page 108 of pickaxe gives me the following syntax error, for
> instance:
>
> ./try4.rb:11: syntax error
> rescue SystemCallError
> ^
> xeno@linux:~/study/data>
>
> Presumably there is something simple I'm doing wrong. Please make a
> suggestion, as I'm really stuck.

Can you post the whole file, or at least the context in which this
statement is used?
Kinda hard to catch syntax errors without the code.

Gennady

6/8/2005 1:05:00 AM

0

Check your typing, you may have missed ), or end, or begin. Paste the
whole exercise, otherwise it is impossible to pin-point the problem.

Gennady.

On Jun 7, 2005, at 17:15, Assaph Mehr wrote:

>
> Xeno Campanoli wrote:
>> The example on page 108 of pickaxe gives me the following syntax
>> error, for
>> instance:
>>
>> ./try4.rb:11: syntax error
>> rescue SystemCallError
>> ^
>> xeno@linux:~/study/data>
>>
>> Presumably there is something simple I'm doing wrong. Please make a
>> suggestion, as I'm really stuck.
>
> Can you post the whole file, or at least the context in which this
> statement is used?
> Kinda hard to catch syntax errors without the code.
>
>



Xeno Campanoli

6/8/2005 1:14:00 AM

0

Assaph Mehr wrote:

>Xeno Campanoli wrote:
>
>
>>The example on page 108 of pickaxe gives me the following syntax error, for
>>instance:
>>
>>./try4.rb:11: syntax error
>>rescue SystemCallError
>> ^
>>xeno@linux:~/study/data>
>>
>>Presumably there is something simple I'm doing wrong. Please make a
>>suggestion, as I'm really stuck.
>>
>>
>
>Can you post the whole file, or at least the context in which this
>statement is used?
>Kinda hard to catch syntax errors without the code.
>
>
Sorry, I tried to say before, I figured it out. It turns out you have
to put the rescue segment
on the bottom of the block, apparently, and I made it work when I did
that. I was however
fooled by the raise statement I left in afterwards. In taking out the
raise, and putting in
my own diagnostics, I now have mostly what I want, though it would be
nicer to get a line
number or statement indicator at the rescue point. For now I'm just
assigning the line to a
global to keep it around. If anyone can make a suggestion on that, it
would also be helpful.

Thanks to the several people who have helped me on this.

Sincerely,

Xeno

>
>
>
>
>


--
Xeno Campanoli, xeno@eskimo.com, http://www.eskimo...
Pride before justice equals destabilization.
Power before truth equals destruction.
Profit before environment equals death.



Gennady

6/8/2005 2:45:00 AM

0

If you want to know where the exception was originated from, you can
use Exception#backtrace method. With a little bit of parsing, you will
get a line number and a method name.

Gennady.
On Jun 7, 2005, at 18:14, Xeno Campanoli wrote:

> Assaph Mehr wrote:
>
>> Xeno Campanoli wrote:
>>
>>> The example on page 108 of pickaxe gives me the following syntax
>>> error, for
>>> instance:
>>>
>>> ./try4.rb:11: syntax error
>>> rescue SystemCallError
>>> ^
>>> xeno@linux:~/study/data>
>>>
>>> Presumably there is something simple I'm doing wrong. Please make a
>>> suggestion, as I'm really stuck.
>>>
>>
>> Can you post the whole file, or at least the context in which this
>> statement is used?
>> Kinda hard to catch syntax errors without the code.
>>
> Sorry, I tried to say before, I figured it out. It turns out you have
> to put the rescue segment
> on the bottom of the block, apparently, and I made it work when I did
> that. I was however
> fooled by the raise statement I left in afterwards. In taking out the
> raise, and putting in
> my own diagnostics, I now have mostly what I want, though it would be
> nicer to get a line
> number or statement indicator at the rescue point. For now I'm just
> assigning the line to a
> global to keep it around. If anyone can make a suggestion on that, it
> would also be helpful.
>
> Thanks to the several people who have helped me on this.
>
> Sincerely,
>
> Xeno
>
>>
>>
>>
>>
>
>
> --
> Xeno Campanoli, xeno@eskimo.com, http://www.eskimo...
> Pride before justice equals destabilization.
> Power before truth equals destruction.
> Profit before environment equals death.
>
>



Xeno Campanoli

6/8/2005 6:14:00 AM

0

Gennady Bystritsky wrote:

> If you want to know where the exception was originated from, you can
> use Exception#backtrace method. With a little bit of parsing, you will
> get a line number and a method name.
>
Thank you. I will try using that in my next draft. I'm trying to
finish one last piece of the first before I get horizontal tonight.

Sincerely, Xeno

--
Xeno Campanoli, xeno@eskimo.com, http://www.eskimo...
Pride before justice equals destabilization.
Power before truth equals destruction.
Profit before environment equals death.



Kent Wills

8/21/2012 9:16:00 AM

0

On Sun, 19 Aug 2012 18:32:11 -0700, "Fidem Turbare, the non-existent
atheist goddess" <goddess@fidemturbare.com> wrote:

>On Sun, 19 Aug 2012 20:03:15 -0500
>"Zacharias Mulletstein" <zachariasm@isright.com> wrote:
>> "Fidem Turbare, the non-existent atheist goddess"
>> <goddess@fidemturbare.com> wrote in message
>> news:20120819174817.620e2786e4ebbfd538f613de@fidemturbare.com...
>>
>> You should be in the state lunatic asylum.
>
>Why?

Free cable TV, of course :)
It should be noted that I don't actually know if cable TV is
offered in any state run mental institution.

--
I could write about noble gases, but there would be no reaction.

Kent Wills

8/21/2012 9:21:00 AM

0

On Sun, 19 Aug 2012 21:07:35 -0500, "Zacharias Mulletstein"
<zachariasm@isright.com> wrote:

>
>
>"Fidem Turbare, the non-existent atheist goddess" <goddess@fidemturbare.com>
>wrote in message
>news:20120819183211.97ef611e54d0124487b03017@fidemturbare.com...
>> On Sun, 19 Aug 2012 20:03:15 -0500
>> "Zacharias Mulletstein" <zachariasm@isright.com> wrote:
>>> "Fidem Turbare, the non-existent atheist goddess"
>>> <goddess@fidemturbare.com> wrote in message
>>> news:20120819174817.620e2786e4ebbfd538f613de@fidemturbare.com...
>>>
>>> You should be in the state lunatic asylum.
>>
>> Why?
>
>Because you're insane and a liar.
>

Please present your evidence that Fidem has been adjudged insane.
I would enjoy seeing it.
I admit I have limited exposure to her posts, but I've not seen
Fidem post a lie. Would you be so kind as to cite a selection of
these lies?
Thank you in advance for supplying both items requested.

--
I could write about noble gases, but there would be no reaction.

Lady Azure, Baroness of the North Pole

8/22/2012 8:08:00 AM

0



K Wills wrote:

> On Sun, 19 Aug 2012 18:32:11 -0700, "Fidem Turbare, the non-existent
> atheist goddess" <goddess@fidemturbare.com> wrote:
>
> >On Sun, 19 Aug 2012 20:03:15 -0500
> >"Zacharias Mulletstein" <zachariasm@isright.com> wrote:
> >> "Fidem Turbare, the non-existent atheist goddess"
> >> <goddess@fidemturbare.com> wrote in message
> >> >>
> >> You should be in the state lunatic asylum.
> >
> >Why?
>
> Free cable TV, of course :)

First Hand Knowledge eh??

Lady Azure, Baroness of the North Pole

8/22/2012 8:09:00 AM

0



K Wills wrote:

> On Sun, 19 Aug 2012 21:07:35 -0500, "Zacharias Mulletstein"
> <zachariasm@isright.com> wrote:
>
> >
> >
> >"Fidem Turbare, the non-existent atheist goddess" <goddess@fidemturbare.com>
> >wrote in message
> >> On Sun, 19 Aug 2012 20:03:15 -0500
> >> "Zacharias Mulletstein" <zachariasm@isright.com> wrote:
> >>> "Fidem Turbare, the non-existent atheist goddess"
> >>> <goddess@fidemturbare.com> wrote in message
> >>> >>>
> >>> You should be in the state lunatic asylum.
> >>
> >> Why?
> >
> >Because you're insane and a liar.
> >
>
> Please present your evidence that Fidem has been adjudged insane.

Like you, who needs Proof, Public Opinion nothing more is required!


Kent Wills

8/22/2012 1:03:00 PM

0

On Tue, 21 Aug 2012 09:30:23 -0700, "Fidem Turbare, the non-existent
atheist goddess" <goddess@fidemturbare.com> wrote:

>On Tue, 21 Aug 2012 04:16:19 -0500
>K Wills <compuelf@gmail.com> wrote:
>> On Sun, 19 Aug 2012 18:32:11 -0700, "Fidem Turbare, the non-existent
>> atheist goddess" <goddess@fidemturbare.com> wrote:
>>> On Sun, 19 Aug 2012 20:03:15 -0500
>>> "Zacharias Mulletstein" <zachariasm@isright.com> wrote:
>>>> "Fidem Turbare, the non-existent atheist goddess"
>>>> <goddess@fidemturbare.com> wrote in message
>>>> news:20120819174817.620e2786e4ebbfd538f613de@fidemturbare.com...
>>>>
>>>> You should be in the state lunatic asylum.
>>>
>>> Why?
>>
>> Free cable TV, of course :)
>> It should be noted that I don't actually know if cable TV is
>> offered in any state run mental institution.
>
>It's there in some of the common areas where patients gather to eat
>lunch or just do what they normally do (e.g., mingling with the dozen or
>so Napoleon Bonaparte's wandering around aimlessly, hunting for
>treasure, practicing theoretical magic, trying to escape, etc.),

That reminds me of a joke the character of Bester said on an
episode of Babylon 5 (it's not verbatim):

A man in a mental institution asks another who he is.
"I am Napoleon!"
"How do you know you are?"
"God told me."
From the next bed comes, "I did not!"


>but I
>suspect that the orderlies usually decide which channels to watch.

Probably not much Jerry Springer being shown.

--
"Hail imp," shouted Vlad, the Imp Hailer.