Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
c3acb60b
Commit
c3acb60b
authored
10 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
test if stacktrace is added to ErrorData
parent
84d5762a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!199
Resolve "[MIN-321] form for reporting errors in minerva"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/utils/error-report/errorReporting.test.ts
+9
-0
9 additions, 0 deletions
src/utils/error-report/errorReporting.test.ts
src/utils/error-report/errorReporting.ts
+6
-1
6 additions, 1 deletion
src/utils/error-report/errorReporting.ts
with
15 additions
and
1 deletion
src/utils/error-report/errorReporting.test.ts
0 → 100644
+
9
−
0
View file @
c3acb60b
/* eslint-disable no-magic-numbers */
import
{
createErrorData
}
from
'
@/utils/error-report/errorReporting
'
;
describe
(
'
createErrorData
'
,
()
=>
{
it
(
'
should add stacktrace
'
,
()
=>
{
const
error
=
createErrorData
(
new
Error
(
'
hello
'
));
expect
(
error
.
stacktrace
).
not
.
toEqual
(
''
);
});
});
This diff is collapsed.
Click to expand it.
src/utils/error-report/errorReporting.ts
+
6
−
1
View file @
c3acb60b
...
...
@@ -2,7 +2,7 @@
import
{
ErrorData
}
from
'
@/utils/error-report/ErrorData
'
;
import
{
SerializedError
}
from
'
@reduxjs/toolkit
'
;
export
const
handl
eError
=
(
error
:
Error
|
SerializedError
|
undefined
):
void
=>
{
export
const
creat
eError
Data
=
(
error
:
Error
|
SerializedError
|
undefined
):
ErrorData
=>
{
let
stacktrace
=
''
;
if
(
error
!==
undefined
)
{
stacktrace
=
error
.
stack
!==
undefined
?
error
.
stack
:
''
;
...
...
@@ -19,6 +19,11 @@ export const handleError = (error: Error | SerializedError | undefined): void =>
timestamp
:
null
,
// TODO
version
:
null
,
// TODO
};
return
errorData
;
};
export
const
handleError
=
(
error
:
Error
|
SerializedError
|
undefined
):
void
=>
{
const
errorData
=
createErrorData
(
error
);
// eslint-disable-next-line no-console
console
.
log
(
errorData
);
};
...
...
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