diff --git a/packages/desktop-app/src/Ethminer.ts b/packages/desktop-app/src/Ethminer.ts index dd7fc3a47..74226d927 100644 --- a/packages/desktop-app/src/Ethminer.ts +++ b/packages/desktop-app/src/Ethminer.ts @@ -34,7 +34,6 @@ export class Ethminer { // Anti-Virus { error: 'is not recognized as an internal or external command', code: 314159265 }, { error: 'The system cannot find the path specified', code: 314159265 }, - { error: 'Socket write failed', code: 314159265 }, // CUDA { error: '3221225595', code: 8675309 }, { error: '3221225781', code: 8675309 }, @@ -42,16 +41,19 @@ export class Ethminer { { error: 'CUDA error: Insufficient CUDA driver: 7050', code: 8675309 }, { error: 'CUDA error in func', code: 8675309 }, { error: 'No OpenCL platforms found', code: 8675309 }, - // Nonce - { error: 'Invalid nonce', code: 9998 }, // Unknown - { error: 'stratum Error', code: 9999 }, { error: 'exit: 0', code: 9999 }, - // Network Errors - { error: 'Network Error', code: 9999 }, - { error: 'No connection', code: 9999 }, + // Nonce + { error: 'Invalid nonce', code: 9998 }, // No modal errors { error: 'exit: 1', code: 8888 }, + // Network Errors + { error: 'Network Error', code: 4000 }, + { error: 'stratum Error', code: 4001 }, + { error: 'stratum Error', code: 4001 }, + { error: 'Socket read failed', code: 4002 }, + { error: 'Socket write failed', code: 4003 }, + { error: 'No connection', code: 4004 }, ] errors.map(item => { diff --git a/packages/web-app/src/Routes.tsx b/packages/web-app/src/Routes.tsx index 6f3b76947..1f6ac34d0 100644 --- a/packages/web-app/src/Routes.tsx +++ b/packages/web-app/src/Routes.tsx @@ -29,7 +29,12 @@ import { import { AccountModalContainer } from './modules/profile-views' import { AnimatedSwitch } from './components/AnimatedSwitch' import { CompatibilityCheckPageContainer } from './modules/machine-views' -import { CudaErrorContainer, UnknownErrorContainer, AntiVirusErrorContainer } from './modules/error-views' +import { + AntiVirusErrorContainer, + CudaErrorContainer, + NetworkErrorContainer, + UnknownErrorContainer, +} from './modules/error-views' // Settings Menu import { SettingsContainer } from './modules/settings-views' // Account Menu @@ -143,8 +148,9 @@ const Auth = () => { return ( <> } /> - + + diff --git a/packages/web-app/src/modules/error-views/NetworkErrorContainer.ts b/packages/web-app/src/modules/error-views/NetworkErrorContainer.ts new file mode 100644 index 000000000..635fa839c --- /dev/null +++ b/packages/web-app/src/modules/error-views/NetworkErrorContainer.ts @@ -0,0 +1,14 @@ +import { connect } from '../../connect' +import { RootStore } from '../../Store' +import { NetworkErrorPage } from './components/NetworkErrorPage' + +const mapStoreToProps = (store: RootStore) => ({ + onCloseClicked: () => store.ui.hideModal(), + onSendLog: store.native.sendLog, + showSendLog: store.native.canSendLogs, +}) + +export const NetworkErrorContainer = connect( + mapStoreToProps, + NetworkErrorPage, +) diff --git a/packages/web-app/src/modules/error-views/components/NetworkErrorPage.tsx b/packages/web-app/src/modules/error-views/components/NetworkErrorPage.tsx new file mode 100644 index 000000000..457317358 --- /dev/null +++ b/packages/web-app/src/modules/error-views/components/NetworkErrorPage.tsx @@ -0,0 +1,33 @@ +import React, { Component } from 'react' + +// Components +import { ErrorPage } from '../../../components/ErrorPage' + +interface Props { + onCloseClicked?: () => void + showSendLog?: boolean + onSendLog?: () => void +} + +export class NetworkErrorPage extends Component { + handleSendLogClicked = () => { + const { onSendLog } = this.props + + if (onSendLog) onSendLog() + } + + render() { + const { showSendLog, onCloseClicked } = this.props + + return ( + +
It appears this we are having trouble connecting to the Salad mining pool.
+
+ ) + } +} diff --git a/packages/web-app/src/modules/error-views/index.ts b/packages/web-app/src/modules/error-views/index.ts index 9c23abdb0..de838c21f 100644 --- a/packages/web-app/src/modules/error-views/index.ts +++ b/packages/web-app/src/modules/error-views/index.ts @@ -1,3 +1,5 @@ -export * from './UnknownErrorContainer' -export * from './CudaErrorContainer' export * from './AntiVirusErrorContainer' +export * from './CudaErrorContainer' +export * from './NetworkErrorContainer' +export * from './UnknownErrorContainer' + diff --git a/packages/web-app/src/modules/machine/NativeStore.ts b/packages/web-app/src/modules/machine/NativeStore.ts index 4b79d5f8d..fe25cee1f 100644 --- a/packages/web-app/src/modules/machine/NativeStore.ts +++ b/packages/web-app/src/modules/machine/NativeStore.ts @@ -158,23 +158,31 @@ export class NativeStore { console.log('Error code: ', errorCode) switch (errorCode) { - case 8675309: // Tommy Tutone - 867-5309/Jenny: https://youtu.be/6WTdTwcmxyo - this.restartMiner() + case 8675309: // CUDA - Tommy Tutone - 867-5309/Jenny: https://youtu.be/6WTdTwcmxyo store.ui.showModal('/errors/cuda') store.analytics.captureException(new Error(`Received CUDA error code ${errorCode} from native`)) store.analytics.track('CUDA Error', { ErrorCode: errorCode }) break - case 314159265: // Pie! + case 314159265: // Anti-virus - Pie! store.ui.showModal('/errors/anti-virus') store.analytics.captureException(new Error(`Received Anti-Virus error code ${errorCode} from native`)) store.analytics.track('Anti-Virus Error', { ErrorCode: errorCode }) this.stop() break + case 4000: // Network errors + case 4001: + case 4002: + case 4003: + case 4004: + store.ui.showModal('/errors/network') + this.restartMiner() + store.analytics.track('Network Error', { ErrorCode: errorCode }) + break case 8888: // Generic, ethminer.exe terminated, no modal error message - store.analytics.track('Ethminer.exe Stopped', { ErrorCode: 8888 }) + store.analytics.track('Ethminer.exe Stopped', { ErrorCode: errorCode }) this.stop() break - case 9998: + case 9998: // Nonce this.restartMiner() store.analytics.captureException(new Error(`Received Nonce error code ${errorCode} from native`)) store.analytics.track('Nonce Unknown Error', { ErrorCode: errorCode })