Skip to content

Commit

Permalink
Merge pull request #292 from justinlampley/GenericBuildErrorMessage
Browse files Browse the repository at this point in the history
Generic build error message
  • Loading branch information
jurgelenas authored Mar 17, 2022
2 parents 90077cd + 00ce351 commit 3c82644
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
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

0 comments on commit 3c82644

Please sign in to comment.