Skip to content

Commit a1e34f8

Browse files
committed
Update ujs files
1 parent eb87c72 commit a1e34f8

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lib/assets/javascripts/react_ujs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,14 @@ module.exports = function(reqctx) {
185185
try {
186186
// `require` will raise an error if this className isn't found:
187187
component = fromCtx(className)
188-
} catch (err) {
188+
} catch (firstErr) {
189189
// fallback to global:
190-
component = fromGlobal(className)
190+
try {
191+
component = fromGlobal(className)
192+
} catch (secondErr) {
193+
console.error(firstErr)
194+
console.error(secondErr)
195+
}
191196
}
192197
return component
193198
}

react_ujs/dist/react_ujs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,14 @@ module.exports = function(reqctx) {
185185
try {
186186
// `require` will raise an error if this className isn't found:
187187
component = fromCtx(className)
188-
} catch (err) {
188+
} catch (firstErr) {
189189
// fallback to global:
190-
component = fromGlobal(className)
190+
try {
191+
component = fromGlobal(className)
192+
} catch (secondErr) {
193+
console.error(firstErr)
194+
console.error(secondErr)
195+
}
191196
}
192197
return component
193198
}

0 commit comments

Comments
 (0)