Always diplay sad face on errors; use nullCheck() function; see https://github.com/Microsoft/pxt/issues/302

This commit is contained in:
Michal Moskal
2016-09-05 14:26:07 +01:00
parent 50293fc654
commit 61a29f7c67
4 changed files with 64 additions and 66 deletions

View File

@ -19,24 +19,6 @@ namespace pxsim {
export function panic(code: number) {
console.log("PANIC:", code)
led.setBrightness(255);
let img = board().ledMatrixState.image;
img.clear();
img.set(0, 4, 255);
img.set(1, 3, 255);
img.set(2, 3, 255);
img.set(3, 3, 255);
img.set(4, 4, 255);
img.set(0, 0, 255);
img.set(1, 0, 255);
img.set(0, 1, 255);
img.set(1, 1, 255);
img.set(3, 0, 255);
img.set(4, 0, 255);
img.set(3, 1, 255);
img.set(4, 1, 255);
runtime.updateDisplay();
throw new Error("PANIC " + code)
}