Wikimedia Developer Support

Unknownerror MediaWiki API

I am trying to fetch a JSON response using a SQL query via a new API I am writing. The SQL query works fine but I am always getting unknownerror in the API. Is there a way to debug this? I tried var_dump, print and echo on the API class but with no output.

Do not put print() statements or such in code, that’s probably not going to work or cause other errors. Use wfDebugLog instead.

See the section on Creating custom log groups. then configure logging for exception, error and your custom log (that you’ll be writing with wfDebugLog( 'yourcustomgroup', 'Text to dump to the log' );)

1 Like