gavgaurav / nativelibs4java

Automatically exported from code.google.com/p/nativelibs4java
0 stars 0 forks source link

BridJ: Add errno support #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On platforms that support the errno mechanism, we should support an @errno 
annotation on functions that alter the errno variable and throw an exception if 
the error code is != 0 after the method call.

Original issue reported on code.google.com by olivier.chafik@gmail.com on 29 Jun 2011 at 1:45

GoogleCodeExporter commented 9 years ago
Work done on Unix as part of revision #2166.

Original comment by olivier.chafik@gmail.com on 29 Jun 2011 at 3:49

GoogleCodeExporter commented 9 years ago
Are you sure java.lang.Error is the appropriate superclass for LastError? "An 
Error is a subclass of Throwable that indicates serious problems that a 
reasonable application should not try to catch." (Javadoc) However, 
applications can very easily want to catch LastError, extract the error code, 
and handle at least some of them, like the "file not found" error of the "open" 
function.

I would choose to LastError from RuntimeException instead.

Original comment by kazocs...@gmail.com on 29 Jun 2011 at 4:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Csaba,

Thanks for your comment !
You're right, RuntimeException makes more sense (even though it feels odd that 
LastError is not an Error ;-)).

Here's the doc (LastError is in the latest 0.6-SNAPSHOT) :
http://nativelibs4java.sourceforge.net/bridj/api/development/org/bridj/LastError
.html

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 30 Jun 2011 at 12:18