Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions cq_server/module_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import List, Dict, Tuple
import glob
import json
import traceback


IGNORE_FILE_NAME = '.cqsignore'
Expand Down Expand Up @@ -121,7 +122,7 @@ def get_result(self):
result = model.build()

if not result.success:
raise ModuleManagerError('Error in model', result.exception)
raise ModuleManagerError('Error in model') from result.exception

return result

Expand Down Expand Up @@ -196,7 +197,7 @@ def get_data(self) -> dict:

data = {
'error': error.message,
'stacktrace': error.stacktrace
'stacktrace': ''.join(traceback.format_exception(type(error), error, error.__traceback__))
}

return data
Expand All @@ -215,12 +216,7 @@ def get_ui_instance(self):
class ModuleManagerError(Exception):
'''Error class used to define ModuleManager errors.'''

def __init__(self, message: str, stacktrace: str=''):
def __init__(self, message: str):
self.message = message
self.stacktrace = stacktrace

print('Module manager error: ' + message, file=sys.stderr)
if stacktrace:
print(stacktrace, file=sys.stderr)

super().__init__(self.message)
13 changes: 10 additions & 3 deletions cq_server/static/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ body {
left: 10%;
top: 10%;
right: 10%;
bottom: 10%;
max-height: 80%;
padding: 1em;
font-family: sans-serif;
z-index: 1000;
overflow: scroll;
overflow: auto;
}

.modal.error {
Expand All @@ -31,7 +31,14 @@ body {
}

.modal pre {
background-color: grey;
display: inline-block;
padding: 10px;
background-color: #565656;
color: white;
box-sizing: border-box;
overflow: visible;
white-space: pre;
min-width: 100%;
}

.cqs_module_item {
Expand Down
1 change: 0 additions & 1 deletion cq_server/static/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function show_error() {

document.getElementById('cqs_error_message').innerText = data.error;
document.getElementById('cqs_stacktrace').innerText = data.stacktrace;
document.getElementById('cqs_stacktrace').style.display = data.stacktrace ? 'block' : 'none';

document.getElementById('cqs_error').style.display = 'block';
}
Expand Down