From: Rob V. <rv...@do...> - 2012-09-27 20:09:45
|
Yes everything in the dotNetRDF exception hierarchy descends from Exception because in .Net everything must descend from Exception in order to be throwable (unlike Java) You should really catch the specific exception type rather than catching Exception and inspecting the type I.e. catch (RdfQueryException queryEx) { //Handle exception } Rob From: Constantinos Orphanides <tra...@ho...> Date: Tuesday, September 25, 2012 8:31 PM To: Rob Vesse <rv...@do...> Subject: RE: dotNetRDF; exception handling > Hi Rob, > > Thanks for the useful info. Do the dotNetRDF exceptions abstract from the > generic Exception? I was thinking of something like: > > catch(Exception ex) > { > if (ex is RdfQueryExeption) > { > //... > } > } > > > Best regards, > > Constantinos Orphanides > Computer Scientist > web: www.constantinosorphanides.com <http://www.constantinosorphanides.com> | > twitter: http://twitter.com/trashr0x > > > > Date: Mon, 24 Sep 2012 15:40:36 -0700 > Subject: Re: dotNetRDF; exception handling > From: rv...@do... > To: tra...@ho... > CC: dot...@li... > > Hi Constantinos > > They should in most cases throw dotNetRDF exceptions, the exceptions you can > get for the Query() method are as follows: > * RdfQueryException / RdfStorageException Something goes wrong making the > query > * RdfParseException Either the query fails validation within dotNetRDF or > the store returns malformed results > * RdfParserSelectionException The query succeeds but returns results in a > format not understood by dotNetRDF > The code does not necessarily catch and wrap standard .Net exceptions so it > may be possible for other errors to be thrown in certain circumstances but all > the expected errors should be in the dotNetRDF exception hierarchy. > > I'll make sure to add thrown exceptions to the XML comments for relevant > methods at some point > > Rob > > From: Constantinos Orphanides <tra...@ho...> > Date: Monday, September 24, 2012 3:15 PM > To: Rob Vesse <rv...@do...> > Subject: dotNetRDF; exception handling > >> Hi Rob, >> >> do: >> >> 1) SesameHttpProtocolConnector owlim = new >> SesameHttpProtocolConnector(repositoryConnection, repositoryId); >> 2) Object results = owlim.Query(sparqlQuery); >> >> Throw exceptions specific to dotNetRDF or the generic Exception class? If >> yes, where can I find some documentation? Couldn't find any in the website's >> API. >> >> Best regards, >> >> Constantinos >> > |