Questions regarding exceptions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions regarding exceptions

Holger Freyther
Hi All,

I try to write a "Load Tests" for the SUnit tool in VisualGST. I know I
should use sunitScript and will change the code but I have a question
with exceptions.


$ PackageLoader fileInPackage: 'Parser'
$ package := PackageLoader packageAt: 'Parser'
$ test := package test
$ files := package fullPathsOf: (test fileIns)
$ files do: [:file | file fileIn ].

Currently the last line will give me exceptions. Now I would just like
to ignore them. So I try

$ files do: [:file |
               [file fileIn ]
                  on: Exception
                  do: [:sig | sig return: nil] ]

Is there a way to completely the exception?

thanks
        holger


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Questions regarding exceptions

Paolo Bonzini-2
> $ PackageLoader fileInPackage: 'Parser'
> $ package := PackageLoader packageAt: 'Parser'
> $ test := package test
> $ files := package fullPathsOf: (test fileIns)
> $ files do: [:file | file fileIn ].
>
> Currently the last line will give me exceptions. Now I would just like
> to ignore them. So I try
>
> $ files do: [:file |
>               [file fileIn ]
>                  on: Exception
>                  do: [:sig | sig return: nil] ]
>
> Is there a way to completely the exception?

Well, the question is "what exception"?

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Questions regarding exceptions

Holger Freyther
On 05/01/2010 03:43 PM, Paolo Bonzini wrote:

>> $ files do: [:file |
>>               [file fileIn ]
>>                  on: Exception
>>                  do: [:sig | sig return: nil] ]
>>
>> Is there a way to completely the exception?
>
> Well, the question is "what exception"?

Any exception. It is a bit difficult to identify the start of an
exception with the gst shell. I just want to catch everything that might
go wrong from within the fileIn.

but something like this:

/home/ich/install/gst/share/smalltalk/Parser.star#VFS.ZipFile/RewriteTests.st:36:
key TestCase not found
/home/ich/install/gst/share/smalltalk/Parser.star#VFS.ZipFile/RewriteTests.st:36:
expected Eval, Namespace or class definition
/home/ich/install/gst/share/smalltalk/Parser.star#VFS.ZipFile/RewriteTests.st:88:
expected Eval, Namespace or class definition
Object: nil error: did not understand #rewriterClass
Smalltalk.MessageNotUnderstood(Smalltalk.Exception)>>signal
(ExcHandling.st:254)
Smalltalk.UndefinedObject(Smalltalk.Object)>>doesNotUnderstand:
#rewriterClass (SysExcept.st:1436)
Smalltalk.UndefinedObject>>executeStatements
(Parser.star#VFS.ZipFile/RewriteTests.st:180)




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Questions regarding exceptions

Paolo Bonzini-2
In reply to this post by Paolo Bonzini-2
On Sat, May 1, 2010 at 09:43, Paolo Bonzini <[hidden email]> wrote:
>> $ PackageLoader fileInPackage: 'Parser'
>> $ package := PackageLoader packageAt: 'Parser'
>> $ test := package test
>> $ files := package fullPathsOf: (test fileIns)
>> $ files do: [:file | file fileIn ].
>>
>> Currently the last line will give me exceptions. Now I
>> would just like to ignore them.

What you want here is to use the ClassLoader (like gst-doc and IIRC
also gst-convert do), not #fileIn.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk