[SOLVED] Problem with setError
- kylehamilton
- Posts: 29
- Joined: Fri Mar 24, 2017 8:47 am
- Location: Merced, California, USA
- Contact:
[SOLVED] Problem with setError
Hi I'm trying to get my Jamovi module to display an error message when the code in the background gives a warning or stop command. Is there some example code somewhere that I could look at? Right now before a user assigns variables in Jamovi metafor throws up an error asking for either vi (sampling variances) or sei (standard errors). What I would like for it to do is when this error happens have Jamovi display a custom error message instead. I've gone over the documentation but it's still not working.
Re: Problem with setError
Hi Kyle,
You can use jmvcore::reject() for this. You can find an example of its use over here: https://github.com/jamovi/jmv/blob/99ed ... #L204-L219.
Cheers
You can use jmvcore::reject() for this. You can find an example of its use over here: https://github.com/jamovi/jmv/blob/99ed ... #L204-L219.
Cheers
Re: Problem with setError
However, instead of throwing an error it might make more sense to only run the analysis when the variables are assigned (that's what we do with our analyses). You can find an example of this in the same file: https://github.com/jamovi/jmv/blob/99ed ... .R#L14-L18.
- kylehamilton
- Posts: 29
- Joined: Fri Mar 24, 2017 8:47 am
- Location: Merced, California, USA
- Contact:
Re: Problem with setError
Thank you so much! This fixed everything and makes the module look a lot cleaner. I never even thought to check the help file in jmvcore I was only looking at the dev website. I'll make sure to check jmvcore next time I run into a problem.