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

Error suppression #1

Open
JuliaS92 opened this issue Nov 28, 2013 · 1 comment
Open

Error suppression #1

JuliaS92 opened this issue Nov 28, 2013 · 1 comment

Comments

@JuliaS92
Copy link

Hi,
I am writing a pretty huge application using RGtk2 and I want to prevent errormessages produced by RGtk2-functions from being printed to the R-console, without just redirecting the stderr putput. I already tried to solve it using handleError, but in my case this only changed the function output, but the error message was still printed.

Am I doing something wrong with this code? (New error handling is enabled) It is always printing the error and the only difference in using handleError is the additional NULL printed.

App <- gtkWindow(show = TRUE)
Box <- gtkEntry()
App$add(Box)

Set <- list()
Box$setText(Set$Entry)

handleError(Box$setText(Set$Entry), FALSE)
handleError(Box$setText(Set$Entry), TRUE)

Could I please get some help solving this problem?

@lawremi
Copy link
Owner

lawremi commented Nov 28, 2013

With the new error handling, GTK+ errors become R conditions, so they can
be handled like any other condition. For example, you could wrap the
error-causing call in try(call, silent=TRUE). Of course, you should have a
good reason for doing this...

On Thu, Nov 28, 2013 at 8:03 AM, JuliaS92 [email protected] wrote:

Hi,
I am writing a pretty huge application using RGtk2 and I want to prevent
errormessages produced by RGtk2-functions from being printed to the
R-console, without just redirecting the stderr putput. I already tried to
solve it using handleError, but in my case this only changed the function
output, but the error message was still printed.

Am I doing something wrong with this code? (New error handling is enabled)
It is always printing the error and the only difference in using
handleError is the additional NULL printed.

App <- gtkWindow(show = TRUE)
Box <- gtkEntry()
App$add(Box)

Set <- list()
Box$setText(Set$Entry)

handleError(Box$setText(Set$Entry), FALSE)
handleError(Box$setText(Set$Entry), TRUE)

Could I please get some help solving this problem?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

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

No branches or pull requests

2 participants