getCredentials: improved error message

This commit is contained in:
Martín M
2020-10-21 19:44:28 -03:00
parent 2f4716f379
commit d274a8d560

View File

@@ -35,8 +35,9 @@ module.exports = {
const error = _get(response, 'error', false);
if (error) {
throw new Error(`Error ${error}: ${response.msg}`);
throw new Error(`[${error}] ${response.msg}`);
}
this.apiKey = _get(response, 'data.user.apikey', '');
this.at = _get(response, 'data.at', '');