Browse Source

Improvement of error message when background prettier process exits prematurely

pipelines/353213535
eidheim 4 years ago
parent
commit
9fe68e4891
  1. 4
      src/source.cpp

4
src/source.cpp

@ -936,7 +936,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
prettier_background_process->write(to_hex_string(get_buffer()->get_text().raw()));
prettier_background_process->write("', 'hex').toString(), {...options, " + options + "})));}catch(error){let _ = process.stderr.write('ParseError: ' + error.message);}}).catch(error => {let _ = process.stderr.write('ConfigError: ' + error.message);});}\n");
int exit_status;
int exit_status = -1;
while(true) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if(prettier_background_process->try_get_exit_status(exit_status))
@ -974,7 +974,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
else
Terminal::get().print("\e[31mError (prettier)\e[m: " + error->message + '\n', true);
}
else if(exit_status > 0)
else if(exit_status >= 0)
Terminal::get().print("\e[31mError (prettier)\e[m: process exited with exit status " + std::to_string(exit_status) + '\n', true);
}
}

Loading…
Cancel
Save