File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed
typescriptlang-org/src/copy/en Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -234,18 +234,23 @@ function rewireLoggingToElement(
234
234
}
235
235
236
236
function produceOutput ( args : any [ ] ) {
237
- let result : string = args . reduce ( ( output : any , arg : any , index ) => {
238
- const textRep = objectToText ( arg )
239
- const showComma = index !== args . length - 1
240
- const comma = showComma ? "<span class='comma'>, </span>" : ""
241
- return output + textRep + comma + " "
242
- } , "" )
243
-
244
- Object . keys ( replacers ) . forEach ( k => {
245
- result = result . replace ( new RegExp ( ( replacers as any ) [ k ] , "g" ) , k )
246
- } )
247
-
248
- return result
237
+ try {
238
+ let result : string = args . reduce ( ( output : any , arg : any , index ) => {
239
+ const textRep = objectToText ( arg )
240
+ const showComma = index !== args . length - 1
241
+ const comma = showComma ? "<span class='comma'>, </span>" : ""
242
+ return output + textRep + comma + " "
243
+ } , "" )
244
+
245
+ Object . keys ( replacers ) . forEach ( k => {
246
+ result = result . replace ( new RegExp ( ( replacers as any ) [ k ] , "g" ) , k )
247
+ } )
248
+
249
+ return result
250
+ } catch ( error ) {
251
+ console . warn ( i ( "play_run_log_fail" ) , error )
252
+ return i ( "play_run_log_fail" )
253
+ }
249
254
}
250
255
}
251
256
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export const playCopy = {
55
55
play_run_js : "Executed JavaScript" ,
56
56
play_run_ts : "Executed transpiled TypeScript" ,
57
57
play_run_js_fail : "Executed JavaScript Failed:" ,
58
+ play_run_log_fail : "Failed to serialize log" ,
58
59
play_default_code_sample : `// Welcome to the TypeScript Playground, this is a website
59
60
// which gives you a chance to write, share and learn TypeScript.
60
61
You can’t perform that action at this time.
0 commit comments