Skip to content

Commit 9b0ef8b

Browse files
committed
refactor: replace generic console logs with contextual error handling
1 parent 83c5c8d commit 9b0ef8b

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

js/utils/utils.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,9 @@ const processPluginData = (activity, pluginData, pluginSource) => {
696696
let obj;
697697
try {
698698
obj = JSON.parse(pluginData);
699-
} catch (e) {
700-
// eslint-disable-next-line no-console
701-
console.log(pluginData);
702-
// eslint-disable-next-line no-console
703-
console.log(e);
699+
} catch (error) {
700+
console.error(`PluginProcessor: Failed to parse plugin data from source "${pluginSource}":`, error);
701+
console.debug("Malformed plugin data:", pluginData);
704702
return null;
705703
}
706704
// Create a palette entry.

planet/js/ProjectStorage.js

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

planet/js/Publisher.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,8 @@ class Publisher {
304304
parseProject(tb) {
305305
try {
306306
tb = JSON.parse(tb);
307-
} catch (e) {
308-
// eslint-disable-next-line no-console
309-
console.log(e);
307+
} catch (error) {
308+
console.error("Publisher: Failed to parse project data for keyword extraction.", error);
310309
return "";
311310
}
312311

0 commit comments

Comments
 (0)