Skip to content

Make Win32Exception extend LastErrorException#613

Merged
twall merged 1 commit intojava-native-access:masterfrom
lgoldstein:win32-as-last-error
Mar 8, 2016
Merged

Make Win32Exception extend LastErrorException#613
twall merged 1 commit intojava-native-access:masterfrom
lgoldstein:win32-as-last-error

Conversation

@lgoldstein
Copy link
Copy Markdown
Contributor

It is only logical since this is what Win32Exception is actually used for

@lgoldstein lgoldstein force-pushed the win32-as-last-error branch from 7a571ad to b9e55b7 Compare March 7, 2016 17:36
@lgoldstein lgoldstein force-pushed the win32-as-last-error branch from b9e55b7 to 21c4f33 Compare March 7, 2016 17:38

public LastErrorException(int code) {
super(formatMessage(code));
protected LastErrorException(int code, String msg) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for making this one protected? If so, javadoc would be appropriate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I just thought it would discourage programmers from creating a new instance that contains code and message unless they are using a derived class to do so (e.g., LinuxException, _MacException - similar to Win32Exception). However,I am quite fine with making it public...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me, you probably never want both. @twall feel free to merge this as is.

twall added a commit that referenced this pull request Mar 8, 2016
Make Win32Exception extend LastErrorException
@twall twall merged commit 6a7d6c2 into java-native-access:master Mar 8, 2016
@lgoldstein lgoldstein deleted the win32-as-last-error branch March 8, 2016 17:03
mstyura pushed a commit to mstyura/jna that referenced this pull request Sep 9, 2024
…ve-access#613)

Motivation:

We should add toString() implementations for our QuicEvent
implementations to make debugging easier.

Modifications:

Add toString() methods

Result:

Easier to log / debug events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants