Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic build error message #292

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions src/ui/components/BuildResponse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ import { SxProps, Theme } from '@mui/system';
import {
BuildFirmwareErrorType,
BuildFlashFirmwareResult,
FirmwareVersionDataInput,
} from '../../gql/generated/types';
import DocumentationLink from '../DocumentationLink';

const styles: SxProps<Theme> = {
errorMessage: {
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
a: {
color: 'white',
},
},
};

interface BuildResponseProps {
response: BuildFlashFirmwareResult | undefined;
firmwareVersionData: FirmwareVersionDataInput | null;
}

const BuildResponse: FunctionComponent<BuildResponseProps> = memo(
({ response }) => {
({ response, firmwareVersionData }) => {
// TODO: translations
const toTitle = (errorType: BuildFirmwareErrorType | undefined): string => {
if (errorType === null || errorType === undefined) {
Expand Down Expand Up @@ -55,7 +59,42 @@ const BuildResponse: FunctionComponent<BuildResponseProps> = memo(
response?.errorType ?? BuildFirmwareErrorType.GenericError
)}
</AlertTitle>
{response?.message}
<p>
An error has occured, see the above log for the exact error
message. If you have not already done so, visit{' '}
<DocumentationLink
firmwareVersion={firmwareVersionData}
url="https://www.expresslrs.org/{version}/"
>
Expresslrs.org
</DocumentationLink>{' '}
and read the{' '}
<DocumentationLink
firmwareVersion={firmwareVersionData}
url="https://www.expresslrs.org/{version}/quick-start/getting-started/"
>
Flashing Guide
</DocumentationLink>{' '}
for your particular device as well as the{' '}
<DocumentationLink
firmwareVersion={firmwareVersionData}
url="https://www.expresslrs.org/{version}/quick-start/troubleshooting/#flashingupdating"
>
Troubleshooting Guide
</DocumentationLink>
. If you are still having issues after reviewing the
documentation, please copy the build logs above to an online paste
site and post in the #help-and-support channel on the{' '}
<DocumentationLink
firmwareVersion={firmwareVersionData}
url="https://discord.gg/dS6ReFY"
>
ExpressLRS Discord
</DocumentationLink>{' '}
with a link to the logs and other relevant information like your
device, which flashing method you were using, and what steps you
have already taken to resolve the issue.
</p>
</Alert>
)}
</>
Expand Down
5 changes: 4 additions & 1 deletion src/ui/views/ConfiguratorView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,10 @@ const ConfiguratorView: FunctionComponent<ConfiguratorViewProps> = (props) => {
active={!buildInProgress}
>
<Box sx={styles.buildNotification}>
<BuildResponse response={response?.buildFlashFirmware} />
<BuildResponse
response={response?.buildFlashFirmware}
firmwareVersionData={firmwareVersionData}
/>
</Box>
{response?.buildFlashFirmware?.success && hasLuaScript && (
<>
Expand Down