Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Debugging Gitlab issue fix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Phileas
Debugging Gitlab issue fix
Commits
b7f0e501
Commit
b7f0e501
authored
1 year ago
by
dx
Browse files
Options
Downloads
Patches
Plain Diff
yeah sure whatever man
parent
a354e5ee
No related branches found
No related tags found
1 merge request
!651
st3m/application: way nicer error display on BundleLoadException
Pipeline
#12653
passed
1 year ago
Stage: check
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/st3m/application.py
+9
-7
9 additions, 7 deletions
python_payload/st3m/application.py
with
9 additions
and
7 deletions
python_payload/st3m/application.py
+
9
−
7
View file @
b7f0e501
...
...
@@ -71,7 +71,9 @@ class Application(BaseView):
class
BundleLoadException
(
BaseException
):
MSG
=
"
failed to load
"
def
__init__
(
self
,
msg
:
Optional
[
str
]
=
None
,
orig_exc
:
Optional
[
Exception
]
=
None
)
->
None
:
def
__init__
(
self
,
msg
:
Optional
[
str
]
=
None
,
orig_exc
:
Optional
[
Exception
]
=
None
)
->
None
:
res
=
self
.
MSG
if
msg
is
not
None
:
res
+=
"
:
"
+
msg
...
...
@@ -293,9 +295,9 @@ class LoadErrorView(BaseView):
direction
=
ins
.
buttons
.
app
if
direction
==
ins
.
buttons
.
PRESSED_LEFT
or
ins
.
captouch
.
petals
[
0
].
pressed
:
self
.
scroll_pos
=
max
(
0
,
self
.
scroll_pos
-
delta_ms
/
100
)
self
.
scroll_pos
=
max
(
0
,
self
.
scroll_pos
-
delta_ms
/
100
)
elif
direction
==
ins
.
buttons
.
PRESSED_RIGHT
or
ins
.
captouch
.
petals
[
5
].
pressed
:
self
.
scroll_pos
=
min
(
self
.
scroll_max
,
self
.
scroll_pos
+
delta_ms
/
100
)
self
.
scroll_pos
=
min
(
self
.
scroll_max
,
self
.
scroll_pos
+
delta_ms
/
100
)
def
draw
(
self
,
ctx
:
Context
)
->
None
:
ctx
.
rgb
(
0.8
,
0.1
,
0.1
)
...
...
@@ -321,7 +323,7 @@ class LoadErrorView(BaseView):
view_end
=
min
(
len
(
self
.
lines
),
view_start
+
self
.
max_lines
)
print
(
view_start
,
view_end
,
self
.
scroll_pos
)
for
line
in
self
.
lines
[
view_start
:
view_end
]:
for
line
in
self
.
lines
[
view_start
:
view_end
]:
ctx
.
move_to
(
-
100
,
y
)
ctx
.
text
(
"
"
.
join
(
line
))
y
+=
15
...
...
@@ -336,11 +338,11 @@ class LoadErrorView(BaseView):
animation
=
10
-
animation
if
view_end
<
len
(
self
.
lines
):
ctx
.
move_to
(
0
,
120
-
animation
/
2
)
ctx
.
move_to
(
0
,
120
-
animation
/
2
)
ctx
.
text
(
"
\ue5db
"
)
if
view_start
>
0
:
ctx
.
move_to
(
0
,
-
105
+
animation
/
2
)
ctx
.
move_to
(
0
,
-
105
+
animation
/
2
)
ctx
.
text
(
"
\ue5d8
"
)
...
...
@@ -367,7 +369,7 @@ class MenuItemAppLaunch(MenuItem):
self
.
_instance
=
self
.
_bundle
.
load
()
except
BundleLoadException
as
e
:
log
.
error
(
f
"
Could not load
{
self
.
label
()
}
:
{
e
}
"
)
if
getattr
(
e
,
'
orig_exc
'
):
if
getattr
(
e
,
"
orig_exc
"
):
e
=
e
.
orig_exc
sys
.
print_exception
(
e
)
err
=
LoadErrorView
(
e
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment