Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore readline errors #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Ignore readline errors #42

wants to merge 2 commits into from

Conversation

bokysan
Copy link

@bokysan bokysan commented May 24, 2016

Hi,

this is just a quick fix that for an issue I've encountered using HenPlus under Docker + AlpineLinux (https://hub.docker.com/r/boky/henplus/).

Basically if the output includes any no-US ASCII charcters java readline liberary chokes and this fix ignores the error, which is not really important in the end.

dventimi and others added 2 commits May 24, 2016 21:23
When the includeantruntime property on the javac Ant task is not
included it causes warnings to be emitted in the build.  Moreover, the
recommendation in the Ant manual has for many years been to set it to
false.  See:  http://ant.apache.org/manual/index.html
certain platforms. This commit should essentially fix the issue.

The error in question is:
Exception in thread "main" java.io.UnsupportedEncodingException:
	at org.gnu.readline.Readline.addToHistoryImpl(Native Method)
	at org.gnu.readline.Readline.addToHistory(Readline.java:259)
	at henplus.HenPlus.storeLineInHistory(HenPlus.java:342)
	at henplus.HenPlus.run(HenPlus.java:464)
	at henplus.HenPlus.main(HenPlus.java:679)
// but due to it being thrown from the native code, it's not
// declared properly on the java interface so we can't
// specifically catch it here.
}
Copy link
Owner

Choose a reason for hiding this comment

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

Could the caught exception be runtime-tested to be an UnsupportedEncoding exception in order to make sure not to swallow anything else?

Copy link
Author

Choose a reason for hiding this comment

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

Probably. Haven't checked. The issue is, that the exception is thrown from the native code, so a bit of unwrapping magic would need to be done. I'll fix and recommit.

@hzeller
Copy link
Contributor

hzeller commented Jan 31, 2020

Any update on this ?

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.

4 participants