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
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
6c56cdbc
Commit
6c56cdbc
authored
Aug 07, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: add more logs on bootloader erros for test
parent
fa261e83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
...page_module/gadget_officejs_bootloader_presentation_js.js
+90
-0
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
View file @
6c56cdbc
...
@@ -3,6 +3,91 @@
...
@@ -3,6 +3,91 @@
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
function
displayErrorContent
(
gadget
,
original_error
)
{
var
error_list
=
[
original_error
],
i
,
error
,
error_text
=
""
;
// Do not break the application in case of errors.
// Display it to the user for now,
// and allow user to go back to the frontpage
// Add error handling stack
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
'
;
}
console
.
error
(
original_error
);
if
(
original_error
instanceof
Error
)
{
console
.
error
(
original_error
.
stack
);
}
console
.
log
(
"
generated error_text:
"
);
console
.
log
(
error_text
);
return
error_text
;
/*if (gadget.props === undefined) {
// Gadget has not yet been correctly initialized
throw error;
}
return gadget.changeState({
error_text: error_text,
url: undefined
});*/
}
function
displayError
(
gadget
,
error
)
{
if
(
error
instanceof
RSVP
.
CancellationError
)
{
return
"
RSVP cancelation error
"
;
}
return
displayErrorContent
(
gadget
,
error
);
}
rJS
(
window
)
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
return
this
.
changeState
(
options
);
return
this
.
changeState
(
options
);
...
@@ -23,6 +108,10 @@
...
@@ -23,6 +108,10 @@
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:
"
;
message
=
"
Last Error:
"
;
console
.
log
(
"
CALLING DISPLAY ERROR...
"
);
var
error_text
=
displayError
(
gadget
,
gadget
.
state
.
error
);
if
(
gadget
.
state
.
error
.
message
)
{
if
(
gadget
.
state
.
error
.
message
)
{
message
+=
gadget
.
state
.
error
.
message
;
message
+=
gadget
.
state
.
error
.
message
;
}
else
{
}
else
{
...
@@ -34,6 +123,7 @@
...
@@ -34,6 +123,7 @@
}
else
{
}
else
{
message
+=
"
"
+
modification_dict
.
error
;
message
+=
"
"
+
modification_dict
.
error
;
}
}
message
+=
"
- ERROR TEXT:
"
+
error_text
;
error_div
.
textContent
=
message
;
error_div
.
textContent
=
message
;
}
}
if
(
modification_dict
.
redirect_url
)
{
if
(
modification_dict
.
redirect_url
)
{
...
...
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