Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
14ce8d8b
Commit
14ce8d8b
authored
Jun 13, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of kompiler.org:trs
parents
4956237c
6bc1ba68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/backend/backend.py
src/backend/backend.py
+12
-4
No files found.
src/backend/backend.py
View file @
14ce8d8b
...
@@ -17,6 +17,9 @@ from tornado.web import RequestHandler, Application
...
@@ -17,6 +17,9 @@ from tornado.web import RequestHandler, Application
from
src.parser
import
Parser
from
src.parser
import
Parser
from
tests.parser
import
ParserWrapper
from
tests.parser
import
ParserWrapper
from
src.validation
import
validate
as
validate_expression
from
src.validation
import
validate
as
validate_expression
import
sys
import
traceback
# Log debug information
# Log debug information
from
logging
import
getLogger
,
DEBUG
from
logging
import
getLogger
,
DEBUG
...
@@ -39,6 +42,11 @@ def get_last_line(handler):
...
@@ -39,6 +42,11 @@ def get_last_line(handler):
return
last_line
return
last_line
def
format_exception
(
e
):
tb
=
sys
.
exc_info
()[
2
]
return
{
'error'
:
str
(
e
),
'traceback'
:
traceback
.
format_tb
(
tb
)}
class
Step
(
RequestHandler
):
class
Step
(
RequestHandler
):
def
post
(
self
):
def
post
(
self
):
try
:
try
:
...
@@ -59,7 +67,7 @@ class Step(RequestHandler):
...
@@ -59,7 +67,7 @@ class Step(RequestHandler):
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
except
Exception
as
e
:
except
Exception
as
e
:
self
.
write
(
{
'error'
:
str
(
e
)}
)
self
.
write
(
format_exception
(
e
)
)
class
Answer
(
RequestHandler
):
class
Answer
(
RequestHandler
):
...
@@ -85,7 +93,7 @@ class Answer(RequestHandler):
...
@@ -85,7 +93,7 @@ class Answer(RequestHandler):
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
except
Exception
as
e
:
except
Exception
as
e
:
self
.
write
(
{
'error'
:
str
(
e
)}
)
self
.
write
(
format_exception
(
e
)
)
class
Hint
(
RequestHandler
):
class
Hint
(
RequestHandler
):
...
@@ -104,7 +112,7 @@ class Hint(RequestHandler):
...
@@ -104,7 +112,7 @@ class Hint(RequestHandler):
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
self
.
write
({
'hint'
:
'No further reduction is possible.'
})
except
Exception
as
e
:
except
Exception
as
e
:
self
.
write
(
{
'error'
:
str
(
e
)}
)
self
.
write
(
format_exception
(
e
)
)
class
Validate
(
RequestHandler
):
class
Validate
(
RequestHandler
):
...
@@ -143,7 +151,7 @@ class Validate(RequestHandler):
...
@@ -143,7 +151,7 @@ class Validate(RequestHandler):
self
.
write
({
'validated'
:
i
-
skipped
})
self
.
write
({
'validated'
:
i
-
skipped
})
except
Exception
as
e
:
except
Exception
as
e
:
i
-=
1
i
-=
1
self
.
write
(
{
'error'
:
str
(
e
),
'validated'
:
i
-
skipped
})
self
.
write
(
format_exception
(
e
)
+
{
'validated'
:
i
-
skipped
})
urls
=
[
urls
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment