How to remove 401 error message from the console with AngularJS / Javascript?

2

I get the following error message in my console:

POST http://localhost:8080/minhaURL 401 (Unauthorized)

I would like to know how I can remove this error log from the console, since I am already giving a visual feedback to the user that he missed something.

Just to contextualize, I'm doing a POST with a password, and if it is incorrect, I return a 401.

EDIT:

JS

    requestHandler.authenticate(password).then(function(response){
         console.log('200 ok');
    }).catch(function(err){
         console.log('401 deu erro na validação')
    });

This is an error message which I am referring to:

    
asked by anonymous 18.01.2017 / 14:42

2 answers

3

There is no way to prevent output to the console.

If you want to force complete log cleanup, use

console.clear();

However this will delete all rows, not just the last rows.

    
18.01.2017 / 15:12
0
.catch(function(err, status){
    if (status === 401) return;
    console.log('algo diferente de 401');
});
    
18.01.2017 / 14:51