-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15f7ef2
commit 43a31d3
Showing
14 changed files
with
117 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#2: You should not set multiply entry script in one entry html, but {props.getErrorCodeArg(0)} has at least 2 entry scripts</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#3: entry {props.getErrorCodeArg(0)} load failed as entry script {props.getErrorCodeArg(1)} load failed</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#4: entry {props.getErrorCodeArg(0)} response body is empty!</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#5: {props.getErrorCodeArg(0)} entry {props.getErrorCodeArg(1)} load failed as it not export lifecycles</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#6: You need to export lifecycle functions in {props.getErrorCodeArg(0)} entry</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#7: {props.getErrorCodeArg(0)} head element not existed while accessing document.head!</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import CodeSnippet from '../CodeSnippet' | ||
|
||
export default function ErrorCode1(props) { | ||
return ( | ||
<> | ||
<h1>#8: {props.getErrorCodeArg(0)} container {props.getErrorCodeArg(1)} element not ready while rebuilding!</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
export class QiankunError extends Error { | ||
constructor(message: string) { | ||
super(`[qiankun]: ${message}`); | ||
constructor(code: number, message: string, ...args: string[]) { | ||
let errorMessage = `[qiankun #${code}]: ${message ? message + ' ' : ''}`; | ||
if (process.env.NODE_ENV === 'production') { | ||
errorMessage += `See https://qiankun.umijs.org/error/?code=${code}${ | ||
args.length ? `&arg=${args.join('&arg=')}` : '' | ||
}`; | ||
} else { | ||
console.warn('args', ...args); | ||
} | ||
super(errorMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export class QiankunError extends Error { | ||
constructor(code: number, message: string, ...args: string[]) { | ||
let errorMessage = `[qiankun #${code}]: ${message ? message + ' ' : ''}`; | ||
if (process.env.NODE_ENV === 'production') { | ||
errorMessage += `See https://qiankun.umijs.org/error/?code=${code}${ | ||
args.length ? `&arg=${args.join('&arg=')}` : '' | ||
}`; | ||
} else { | ||
console.warn('args', ...args); | ||
} | ||
super(errorMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters