Skip to content

Commit 634b88c

Browse files
committed
Refactor error and warning messages for clarity and consistency across stack, cache provider, and utility functions. Update deprecation warning in entry module to provide clearer guidance for removal.
1 parent a44441f commit 634b88c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/core/cache-provider/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CacheProvider.providers = function (provider) {
55
if (provider) {
66
return localstorage;
77
} else {
8-
console.error('Kindly provide valid provider.');
8+
console.error('Missing cache provider. Provide a valid provider and try again.');
99
}
1010
};
1111

src/core/lib/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function transform (type) {
2828
this._query[type].BASE = query;
2929
return this;
3030
} else {
31-
console.error('Kindly provide valid parameters');
31+
console.error('Invalid parameters. Expected a string or an array of field names.');
3232
}
3333
break;
3434
case 2:
@@ -38,11 +38,11 @@ export function transform (type) {
3838
this._query[type][arguments[0]] = query;
3939
return this;
4040
} else {
41-
console.error('Kindly provide valid parameters');
41+
console.error('Invalid parameters. Expected first parameter as a string (reference field UID) and second parameter as a string or an array of field names.');
4242
}
4343
break;
4444
default:
45-
console.error('Kindly provide valid parameters');
45+
console.error('Invalid parameters. Provide either one parameter (field name or array) or two parameters (reference field UID and field name or array).');
4646
}
4747
};
4848
}

src/core/modules/entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export default class Entry {
294294
* @instance
295295
*/
296296
includeOwner () {
297-
console.warn('The includeOwner function is deprecated.');
297+
console.warn('The includeOwner function is deprecated. This functionality is no longer supported. Please remove this method from your code.');
298298
this._query.include_owner = true;
299299
return this;
300300
}

src/core/stack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export default class Stack {
5757
debug: false,
5858
logHandler: (level, data) => {
5959
if (level === 'error' && data) {
60-
console.error(`[error] ${data}`);
60+
console.error(`Error: ${data}`);
6161
} else if (level === 'warning' && data) {
62-
console.warn(`[warning] ${data}`);
62+
console.warn(`Warning: ${data}`);
6363
} else if (level === 'info' && data) {
64-
console.info(`[info] ${data}`);
64+
console.info(`Info: ${data}`);
6565
}
6666
}
6767
};
@@ -426,7 +426,7 @@ export default class Stack {
426426
* .then(function(result) {
427427
* // 'result' is a single contentType information.
428428
* }).catch((error) => {
429-
* console.log(error)
429+
* console.error('An error occurred:', error.message || error)
430430
* });
431431
* @returns {promise}
432432
* @instance

0 commit comments

Comments
 (0)