mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#5818 fix: error message (#3920)
Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgenia
parent
f46857fe6d
commit
e443a88ae7
@@ -26,7 +26,7 @@ interface Props {
|
||||
|
||||
export const DisplayError = observer<Props>(function DisplayError({ root, children, error, errorInfo, className }) {
|
||||
const styles = useS(style);
|
||||
const stack = errorInfo?.componentStack || error?.stack;
|
||||
const stack = error?.stack;
|
||||
|
||||
return (
|
||||
<div role="alert" tabIndex={0} className={s(styles, { error: true, root }, className)}>
|
||||
@@ -39,14 +39,13 @@ export const DisplayError = observer<Props>(function DisplayError({ root, childr
|
||||
<details className={s(styles, { details: true })}>
|
||||
<summary>Details</summary>
|
||||
<p>
|
||||
{error.toString()}
|
||||
{stack && (
|
||||
{stack ? <code>{stack}</code> : error.toString()}
|
||||
{errorInfo?.componentStack && (
|
||||
<>
|
||||
<br />
|
||||
<br />
|
||||
<code>{errorInfo.componentStack}</code>
|
||||
</>
|
||||
)}
|
||||
<code>{stack}</code>
|
||||
</p>
|
||||
</details>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,7 +74,7 @@ export class ErrorBoundary extends React.Component<React.PropsWithChildren<Props
|
||||
|
||||
for (const errorData of this.state.exceptions) {
|
||||
if (this.props.simple) {
|
||||
const stack = errorData.errorInfo?.componentStack || errorData.error.stack;
|
||||
const stack = errorData.error.stack;
|
||||
return (
|
||||
<Suspense fallback={<>Loading...</>}>
|
||||
<div>
|
||||
@@ -94,9 +94,14 @@ export class ErrorBoundary extends React.Component<React.PropsWithChildren<Props
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
{errorData.error.toString()}
|
||||
{stack && <br />}
|
||||
{stack}
|
||||
{stack ? stack : errorData.error.toString()}
|
||||
{errorData.errorInfo?.componentStack && (
|
||||
<>
|
||||
<br />
|
||||
<br />
|
||||
{errorData.errorInfo.componentStack}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{this.props.fallback}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user