Lyricdev
GitHub

LYR-MIG0408

a try around all of main

hint · spec 14-cli

A note of lyric fix --from-4: a try holds all of main, which could not throw in Lyric 4; in Lyric 5 main may.

Explanation

Lyric 4's main could not declare throws, so a program caught what was left around all of it. In Lyric 5 main may throw: the error is reported with its causes, and the exit code is 1.

The migration leaves the try: what its catch does may be meant. Where it only reports, declare throws on main and take the try away.

Example

proposal[LYR-MIG0408] main.lyr:9:5: a 'try' around all of 'main' caught what 'main' could not throw in Lyric 4; in Lyric 5 'main' may throw — where the 'catch' only reports, declare 'throws' on 'main' and take the 'try' away