Check if opt-out set?

is there a possibility to check if user has opt-outed tracking in Piwik?

I use Piwik to track how many and which JavaScript Errors occured in my App. If I can not use Piwik for that, I want to track the error by doing XHR Request to my API as a fallback.

Is that possible?

Thanks in advance!!
Greetings Jan