mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Checks to see if the URL is over 2083 characters and if it is, presents this as the most likely error with an import.
This commit is contained in:
@@ -123,7 +123,15 @@ export default class Coriolis extends React.Component {
|
||||
this._showModal(<ModalImport importString={data}/>);
|
||||
}
|
||||
} catch (err) {
|
||||
this._onError('Failed to import ship', r.path, 0, 0, err);
|
||||
const fullUrl = window.location.href;
|
||||
|
||||
if (fullUrl.length >= 2083) {
|
||||
err = 'URL Length = ' + fullUrl.length;
|
||||
this._onError('Failed to import ship - Potential URL Length issue', r.path, 0, 0, err);
|
||||
}
|
||||
else {
|
||||
this._onError('Failed to import ship - Unknown Reason', r.path, 0, 0, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class ErrorDetails extends React.Component {
|
||||
<div style={{ marginTop: '2em' }}>
|
||||
<div><span className='warning'>Browser:</span> {window.navigator.userAgent}</div>
|
||||
<div><span className='warning'>Path:</span> {this.context.route.canonicalPath}</div>
|
||||
<div><span className='warning'>Error:</span> {error.type || 'Unknown'}</div>
|
||||
<div><span className='warning'>Error:</span> {ed["error"] || 'Unknown'}</div>
|
||||
<div className='warning'>Details:</div>
|
||||
<div><pre>{typeof ed == 'object' ? Object.keys(ed).map((e) => `${e}: ${ed[e]}\n`) : ed}</pre></div>
|
||||
</div>
|
||||
@@ -42,18 +42,67 @@ export default class ErrorDetails extends React.Component {
|
||||
|
||||
const importerror = ed && ed.scriptUrl && ed.scriptUrl.indexOf('/import') != -1;
|
||||
|
||||
return <div className='error'>
|
||||
<h1>Jameson, we have a problem..</h1>
|
||||
<h1><small>{error.message}</small></h1>
|
||||
Import Error handling has been improved, but still isn't perfect. <br/>MOST Import failures are a result of missing modules in Coriolis, <br />OR incorrect import strings generated by third party apps. If you're seeing this page, we may have failed to handle the errors in your import correctly. Please see the data output below, specifically the 'scriptUrl:' section if it's there and then if you feel confident enough, please check the github issues page linked below and see if there is a similar issue already logged. If not, please create a new issue with the data below. If you're not confident, please ask for help on the Coriolis Channel of the EDCD Discord server.
|
||||
if (ed['error'].match(/URL Length/i)) {
|
||||
return <div className='error'>
|
||||
<h1>Jameson, we have a problem..</h1>
|
||||
<h1><small>{error.message}</small></h1>
|
||||
It looks as though you've encountered a URL Length issue for your browser.
|
||||
|
||||
<br /><br />
|
||||
|
||||
This is a known issue with Internet Explorer and Edge, as well as Google Chrome, all of which only support 2083 characters and your URL is:
|
||||
|
||||
<br /><br />
|
||||
|
||||
{ed["error"]} characters.
|
||||
|
||||
<br /><br />
|
||||
|
||||
Please try using another browser first, before reporting an issue, such as Firefox which supports 65,536 characters or Safari, which supports 80,000 characters.
|
||||
|
||||
<br /><br />
|
||||
|
||||
Don't copy the URL from Explorer, Edge or Chrome, as they will have truncated it and the data string will be incorrect. You'll need to change your default browser settings, so that when you click the link, it opens in the browser you want to use.
|
||||
<br /><br />
|
||||
If you're already using Firefox, which supports up to 65,536 characters or Safari, which supports up to 80,000 characters, please see the data output below.
|
||||
<br/><br />
|
||||
<h3>Data Output</h3>
|
||||
{content}
|
||||
</div>;
|
||||
}
|
||||
else {
|
||||
return <div className='error'>
|
||||
<h1>Jameson, we have a problem..</h1>
|
||||
<h1><small>{error.message}</small></h1>
|
||||
Import Error handling has been improved, but still isn't perfect.
|
||||
|
||||
<br /><br />
|
||||
|
||||
If you're seeing this page, we may have failed to handle the errors in your import correctly. Please check the common import failures list and then the data output below, specifically the 'scriptUrl:' section if it's there and then if you feel confident enough, please check the github issues page linked below and see if there is a similar issue already logged. If not, please create a new issue with the data below. If you're not confident, please ask for help on the Coriolis Channel of the EDCD Discord server.
|
||||
|
||||
<br /><br />
|
||||
<h3>Common Import Failures</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Previously, most failures were a result of missing modules in Coriolis, although this is rarer now since the import system was improved. If you're using a module in game and you know it isn't in Coriolis, this could be the problem, please check the data output section below.
|
||||
</li>
|
||||
<li>
|
||||
Incorrect import strings generated by third party apps do still occur, please check the data output below and if the import was from something like EDMC, please check you're using the latest version.
|
||||
</li>
|
||||
<li>
|
||||
You've hit a 'maximum URL Length' for your browser. This is a known issue with Internet Explorer and Edge, as well as Google Chrome, all of which only support 2083 characters. Please try using another browser first, before reporting an issue, such as Firefox which supports 65,536 characters or Safari, which supports 80,000 characters. Don't copy the URL from Explorer, Edge or Chrome, as they will have truncated it and the data string will be incorrect. You'll need to change your default browser settings, so that when you click the link, it opens in the browser you want to use.
|
||||
</li>
|
||||
<li>
|
||||
{importerror ? <div>If you are attempting to import a ship from EDDI or EDMC and are seeing a 'Z_BUF_ERROR' it means that the URL has not been understood correctly by the browser. This is a common problem when using Microsoft Internet Explorer or Microsoft Edge, and you should use another browser instead.</div> : null }
|
||||
</li>
|
||||
</ul>
|
||||
<br/>
|
||||
<div>Please note that this site uses Google Analytics to track performance and usage. If you are blocking cookies, for example using Ghostery, please disable blocking for this site and try again.</div>
|
||||
<br/>
|
||||
<br/>
|
||||
{importerror ? <div>If you are attempting to import a ship from EDDI or EDMC and are seeing a 'Z_BUF_ERROR' it means that the URL has not been provided correctly. This is a common problem when using Microsoft Internet Explorer or Microsoft Edge, and you should use another browser instead.</div> : null }
|
||||
<br/>
|
||||
<div>Please note that this site uses Google Analytics to track performance and usage. If you are blocking cookies, for example using Ghostery, please disable blocking for this site and try again.</div>
|
||||
<br/>
|
||||
{content}
|
||||
</div>;
|
||||
<h3>Data Output</h3>
|
||||
{content}
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
white-space: -moz-pre-wrap;
|
||||
|
||||
Reference in New Issue
Block a user