Q:

How can I disable error logging in console for a Dojo's JsonRest query? 

My project uses a JsonRest store to access it's data.  It'l all working fine.  The problem is that when the server returns an error, even if the correct part of the code is called, and the functionality works as it should, the object logs an ugly error to the console. 
My code:
function loadData() {
    self.storeItem.query({
        'id_metric' : self.selectMetrics.value,
        'id_client' : self.selectClients.value
    }).then(
        (res) => populateResults(res),
        ()=>{
            // this is called correctly...
            query('.res').forEach(domConstruct.destroy);
            domConstruct.place('<tr class="sem res"><td>No results</td></tr>', "tableLines", 'first');
        }
    );
}

. 
// ..but this is logged in console:
Object { message: "Unable to load http://localhost:300…", stack: ".cache["dojo/errors/create"]/</</_3…", response: Object, status: 404, responseText: "{"errors":["Not found…", 
xhr: XMLHttpRequest }

How can I make the store not show the error ?  
I know I could change server behavior to return a code 200 result instead of 404.  But what I want is just to make it not send the error to the console. 

A:

The error is logged by dojo/_base/xhr, which is used internally by dojo/store/JsonRest.  I don't see a clean way to suppress it, unless you are prepared to implement your own store.  If you are this is what you can do:
dojo/_base/xhr has a failOk argument that does exactly what you want but dojo/store/JsonRest doesn't use it and the default is false (log the error to the console).  So you can copy the source of JsonRest and add failOk: true in all xhr calls.  For example in the query function:
    var results = xhr("GET", {
        url: this.target + (query || ""),
        handleAs: "json",
        headers: headers,
        failOk: true
    });

You will still be able to handle the error in your error handler function.