Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
50c48582
Commit
50c48582
authored
Aug 09, 2019
by
Roque
Committed by
Roque
Aug 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: display more error information in bootloader
parent
851df3c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
9 deletions
+75
-9
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
...page_module/gadget_officejs_bootloader_presentation_js.js
+72
-6
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
...age_module/gadget_officejs_bootloader_presentation_js.xml
+3
-3
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
View file @
50c48582
/*global window, rJS*/
/*global window, rJS
, RSVP, Event, XMLHttpRequest
*/
/*jslint nomen: true, maxlen:80, indent:2*/
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
,
RSVP
,
Event
,
XMLHttpRequest
)
{
"
use strict
"
;
function
displayErrorContent
(
original_error
)
{
var
error_list
=
[
original_error
],
i
,
error
,
error_text
=
""
;
error_list
.
push
(
new
Error
(
'
stopping ERP5JS
'
));
for
(
i
=
0
;
i
<
error_list
.
length
;
i
+=
1
)
{
error
=
error_list
[
i
];
if
(
error
instanceof
Event
)
{
error
=
{
string
:
error
.
toString
(),
message
:
error
.
message
,
type
:
error
.
type
,
target
:
error
.
target
};
if
(
error
.
target
!==
undefined
)
{
error_list
.
splice
(
i
+
1
,
0
,
error
.
target
);
}
}
if
(
error
instanceof
XMLHttpRequest
)
{
error
=
{
message
:
error
.
toString
(),
readyState
:
error
.
readyState
,
status
:
error
.
status
,
statusText
:
error
.
statusText
,
response
:
error
.
response
,
responseUrl
:
error
.
responseUrl
,
response_headers
:
error
.
getAllResponseHeaders
()
};
}
if
(
error
.
constructor
===
Array
||
error
.
constructor
===
String
||
error
.
constructor
===
Object
)
{
try
{
error
=
JSON
.
stringify
(
error
);
}
catch
(
ignore
)
{
}
}
error_text
+=
error
.
message
||
error
;
error_text
+=
'
\n
'
;
if
(
error
.
fileName
!==
undefined
)
{
error_text
+=
'
File:
'
+
error
.
fileName
+
'
:
'
+
error
.
lineNumber
+
'
\n
'
;
}
if
(
error
.
stack
!==
undefined
)
{
error_text
+=
'
Stack:
'
+
error
.
stack
+
'
\n
'
;
}
error_text
+=
'
---
\n
'
;
}
return
error_text
;
}
function
displayError
(
error
)
{
if
(
error
instanceof
RSVP
.
CancellationError
)
{
return
"
RSVP cancelation error
"
;
}
return
displayErrorContent
(
error
);
}
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
return
this
.
changeState
(
options
);
})
.
onStateChange
(
function
(
modification_dict
)
{
var
skip_link
,
error_div
,
app_name_div
,
message
,
var
skip_link
,
error_div
,
app_name_div
,
message
,
error_text
,
gadget
=
this
;
if
(
modification_dict
.
app_name
)
{
app_name_div
=
gadget
.
element
.
querySelector
(
"
.app-name
"
);
app_name_div
.
textContent
=
gadget
.
state
.
app_name
+
...
...
@@ -23,11 +82,19 @@
if
(
modification_dict
.
error
)
{
error_div
=
gadget
.
element
.
querySelector
(
"
.error-message
"
);
message
=
"
Last Error:
"
;
error_text
=
displayError
(
gadget
.
state
.
error
);
if
(
gadget
.
state
.
error
.
message
)
{
message
+=
gadget
.
state
.
error
.
message
;
}
else
{
message
+=
JSON
.
stringify
(
gadget
.
state
.
error
);
}
if
(
modification_dict
.
error
.
currentTarget
)
{
message
+=
"
- URL:
"
+
modification_dict
.
error
.
currentTarget
.
responseURL
;
}
else
{
message
+=
"
"
+
modification_dict
.
error
;
}
message
+=
"
- FULL ERROR:
"
+
error_text
;
error_div
.
textContent
=
message
;
}
if
(
modification_dict
.
redirect_url
)
{
...
...
@@ -35,5 +102,4 @@
skip_link
.
setAttribute
(
'
href
'
,
gadget
.
state
.
redirect_url
);
}
});
}(
window
,
rJS
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
Event
,
XMLHttpRequest
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
View file @
50c48582
...
...
@@ -220,7 +220,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
vincent
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
64.45561.47559.9591
</string>
</value>
<value>
<string>
9
77.20600.46420.51012
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
15
15751635.24
</float>
<float>
15
64070032.56
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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