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
Frederic Thoma
erp5
Commits
67631098
Commit
67631098
authored
Nov 11, 2021
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: refactor bootloader error message
parent
7260fb1e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
55 deletions
+46
-55
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
...page_module/gadget_officejs_bootloader_presentation_js.js
+44
-53
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
...age_module/gadget_officejs_bootloader_presentation_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
View file @
67631098
...
@@ -3,64 +3,65 @@
...
@@ -3,64 +3,65 @@
(
function
(
window
,
rJS
,
RSVP
,
Event
,
XMLHttpRequest
)
{
(
function
(
window
,
rJS
,
RSVP
,
Event
,
XMLHttpRequest
)
{
"
use strict
"
;
"
use strict
"
;
function
displayErrorContent
(
original_error
)
{
function
displayErrorContent
(
error_div
,
original_error
)
{
var
error_list
=
[
original_error
],
var
error_list
=
[
original_error
],
i
,
i
,
error
,
error
,
error_text
=
""
;
line
=
"
-----------------------------------------------
"
,
addErrorMessage
=
function
(
parent_div
,
content
)
{
var
sub_error_div
=
document
.
createElement
(
'
div
'
);
sub_error_div
.
classList
.
add
(
'
error-message
'
);
sub_error_div
.
textContent
=
content
;
parent_div
.
appendChild
(
sub_error_div
);
};
error_div
.
textContent
=
line
;
addErrorMessage
(
error_div
,
"
ERROR
"
);
if
(
original_error
.
message
)
{
addErrorMessage
(
error_div
,
original_error
.
message
);
}
if
(
original_error
.
currentTarget
)
{
addErrorMessage
(
error_div
,
"
URL:
"
+
original_error
.
currentTarget
.
responseURL
);
}
addErrorMessage
(
error_div
,
line
);
addErrorMessage
(
error_div
,
"
FULL ERROR INFORMATION:
"
);
error_list
.
push
(
new
Error
(
'
stopping ERP5JS
'
));
error_list
.
push
(
new
Error
(
'
stopping ERP5JS
'
));
for
(
i
=
0
;
i
<
error_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
error_list
.
length
;
i
+=
1
)
{
error
=
error_list
[
i
];
error
=
error_list
[
i
];
if
(
error
instanceof
Event
)
{
if
(
error
instanceof
XMLHttpRequest
)
{
error
=
{
addErrorMessage
(
error_div
,
"
- readyState:
"
+
error
.
readyState
);
string
:
error
.
toString
(),
addErrorMessage
(
error_div
,
"
- status:
"
+
error
.
status
);
message
:
error
.
message
,
addErrorMessage
(
error_div
,
"
- statusText:
"
+
error
.
statusText
);
type
:
error
.
type
,
addErrorMessage
(
error_div
,
"
- response:
"
+
error
.
response
);
target
:
error
.
target
addErrorMessage
(
error_div
,
"
- responseUrl:
"
+
error
.
responseUrl
);
};
addErrorMessage
(
error_div
,
"
- response_headers:
"
+
error
.
getAllResponseHeaders
());
}
else
if
(
error
instanceof
Event
)
{
addErrorMessage
(
error_div
,
"
- type:
"
+
error
.
type
);
addErrorMessage
(
error_div
,
"
- target:
"
+
error
.
target
);
if
(
error
.
target
!==
undefined
)
{
if
(
error
.
target
!==
undefined
)
{
error_list
.
splice
(
i
+
1
,
0
,
error
.
target
);
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
||
if
(
error
.
constructor
===
Array
||
error
.
constructor
===
String
||
error
.
constructor
===
String
||
error
.
constructor
===
Object
)
{
error
.
constructor
===
Object
)
{
try
{
addErrorMessage
(
error_div
,
"
- Full error:
"
+
JSON
.
stringify
(
error
));
error
=
JSON
.
stringify
(
error
);
}
catch
(
ignore
)
{
}
}
if
(
error
.
message
)
{
addErrorMessage
(
error_div
,
"
- message:
"
+
error
.
message
);
}
}
error_text
+=
error
.
message
||
error
;
error_text
+=
'
\n
'
;
if
(
error
.
fileName
!==
undefined
)
{
if
(
error
.
fileName
!==
undefined
)
{
error_text
+=
'
File:
'
+
addErrorMessage
(
error_div
,
"
- file:
"
+
error
.
fileName
+
error
.
fileName
+
'
:
'
+
error
.
lineNumber
);
'
:
'
+
error
.
lineNumber
+
'
\n
'
;
}
}
if
(
error
.
stack
!==
undefined
)
{
if
(
error
.
stack
!==
undefined
)
{
error_text
+=
'
Stack:
'
+
error
.
stack
+
'
\n
'
;
addErrorMessage
(
error_div
,
line
);
}
addErrorMessage
(
error_div
,
"
STACK
"
);
error_text
+=
'
---
\n
'
;
addErrorMessage
(
error_div
,
error
.
stack
);
}
return
error_text
;
}
}
addErrorMessage
(
error_div
,
line
);
function
displayError
(
error
)
{
if
(
error
instanceof
RSVP
.
CancellationError
)
{
return
"
RSVP cancelation error
"
;
}
}
return
displayErrorContent
(
error
);
}
}
rJS
(
window
)
rJS
(
window
)
...
@@ -68,7 +69,7 @@
...
@@ -68,7 +69,7 @@
return
this
.
changeState
(
options
);
return
this
.
changeState
(
options
);
})
})
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
skip_link
,
error_div
,
app_name_div
,
message
,
error_text
,
var
skip_link
,
error_div
,
app_name_div
,
gadget
=
this
;
gadget
=
this
;
if
(
modification_dict
.
app_name
)
{
if
(
modification_dict
.
app_name
)
{
app_name_div
=
gadget
.
element
.
querySelector
(
"
.app-name
"
);
app_name_div
=
gadget
.
element
.
querySelector
(
"
.app-name
"
);
...
@@ -81,21 +82,11 @@
...
@@ -81,21 +82,11 @@
}
}
if
(
modification_dict
.
error
)
{
if
(
modification_dict
.
error
)
{
error_div
=
gadget
.
element
.
querySelector
(
"
.error-message
"
);
error_div
=
gadget
.
element
.
querySelector
(
"
.error-message
"
);
message
=
"
Last Error:
"
;
if
(
gadget
.
state
.
error
instanceof
RSVP
.
CancellationError
)
{
error_text
=
displayError
(
gadget
.
state
.
error
);
error_div
.
textContent
=
"
RSVP cancelation 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
{
}
else
{
message
+=
"
"
+
modification_dict
.
error
;
displayErrorContent
(
error_div
,
gadget
.
state
.
error
)
;
}
}
message
+=
"
- FULL ERROR:
"
+
error_text
;
error_div
.
textContent
=
message
;
}
}
if
(
modification_dict
.
redirect_url
)
{
if
(
modification_dict
.
redirect_url
)
{
skip_link
=
gadget
.
element
.
querySelector
(
"
.skip-link
"
);
skip_link
=
gadget
.
element
.
querySelector
(
"
.skip-link
"
);
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
View file @
67631098
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
77.20600.46420.51012
</string>
</value>
<value>
<string>
9
96.6524.39016.52480
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
564070032.56
</float>
<float>
1
636726847.78
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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