Skip to content

Commit 7d60dd4

Browse files
author
t-kazu
committed
errorログを出力するようにしました
1 parent 7846e96 commit 7d60dd4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/ruby-generator/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import _ from 'lodash';
2+
import minilog from 'minilog';
23

34
import GeneratedBlocks from './generated.js';
45
import MathBlocks from './math.js';
@@ -495,13 +496,16 @@ export default function (Blockly) {
495496

496497
Blockly.Ruby.blockToCode_ = Blockly.Ruby.blockToCode;
497498

499+
minilog.enable();
500+
const log = minilog('ruby-generator');
498501
Blockly.Ruby.blockToCode = function (block) {
499502
if (block && !block.disabled && block.type.match(/^hardware_/)) {
500503
this.definitions_.prepare__init_hardware = 'init_hardware';
501504
}
502505
try {
503506
return this.blockToCode_(block);
504507
} catch (error) {
508+
log.error(`'${block.type}' block is not unsupported to generate Ruby code. Please implement it.`);
505509
return null;
506510
}
507511
};

0 commit comments

Comments
 (0)