mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Further improvement error reporting with buggy custom G-code sections #1516
1) The macro-processor sanitizes the source code line for invalid UTF-8 characters. Ideally these invalid characters would be replaced with ?, they are just dropped as of now. Better than showing an empty string when converting to wxString though. 2) G-code export collects full error message for 1st occurence of an error for each custom G-code block. 3) The composite error message now displays the errors collected in 2). 4) The error window is now scaled bigger and the Slicer logo is smaller if the text is to be rendered with monospaced font, as the monospaced text will not be word wrapped.
This commit is contained in:
@@ -68,9 +68,10 @@ bool SlicingProcessCompletedEvent::invalidate_plater() const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string SlicingProcessCompletedEvent::format_error_message() const
|
||||
std::pair<std::string, bool> SlicingProcessCompletedEvent::format_error_message() const
|
||||
{
|
||||
std::string error;
|
||||
bool monospace = false;
|
||||
try {
|
||||
this->rethrow_exception();
|
||||
} catch (const std::bad_alloc& ex) {
|
||||
@@ -78,12 +79,15 @@ std::string SlicingProcessCompletedEvent::format_error_message() const
|
||||
"If you are sure you have enough RAM on your system, this may also be a bug and we would "
|
||||
"be glad if you reported it."))) % SLIC3R_APP_NAME).str());
|
||||
error = std::string(errmsg.ToUTF8()) + "\n\n" + std::string(ex.what());
|
||||
} catch (PlaceholderParserError &ex) {
|
||||
error = ex.what();
|
||||
monospace = true;
|
||||
} catch (std::exception &ex) {
|
||||
error = ex.what();
|
||||
} catch (...) {
|
||||
error = "Unknown C++ exception.";
|
||||
}
|
||||
return error;
|
||||
return std::make_pair(std::move(error), monospace);
|
||||
}
|
||||
|
||||
BackgroundSlicingProcess::BackgroundSlicingProcess()
|
||||
|
||||
Reference in New Issue
Block a user