2016-08-25 17:06:01 +00:00
|
|
|
import React, {Component, PropTypes} from 'react';
|
|
|
|
|
|
|
|
import Link from '../../components/base/Link';
|
2016-11-07 20:24:38 +00:00
|
|
|
import {showModal} from '../modals/index';
|
2016-08-25 17:06:01 +00:00
|
|
|
import SettingsModal from '../modals/SettingsModal';
|
|
|
|
|
|
|
|
class ResponseError extends Component {
|
|
|
|
render () {
|
|
|
|
const {error} = this.props;
|
|
|
|
|
|
|
|
let msg = null;
|
|
|
|
if (error && error.toLowerCase().indexOf('certificate') !== -1) {
|
|
|
|
msg = (
|
|
|
|
<button className="btn btn--super-compact btn--outlined"
|
2016-11-07 20:24:38 +00:00
|
|
|
onClick={() => showModal(SettingsModal)}>
|
2016-08-25 17:06:01 +00:00
|
|
|
Disable SSL Validation
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
} else if (error && error.toLowerCase().indexOf('getaddrinfo') !== -1) {
|
|
|
|
msg = (
|
|
|
|
<button className="btn btn--super-compact btn--outlined"
|
2016-11-07 20:24:38 +00:00
|
|
|
onClick={() => showModal(SettingsModal)}>
|
2016-08-25 17:06:01 +00:00
|
|
|
Setup Network Proxy
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
msg = (
|
2016-11-23 19:33:24 +00:00
|
|
|
<Link button={true}
|
|
|
|
className="btn btn--super-compact btn--outlined"
|
|
|
|
href="https://insomnia.rest/documentation/">
|
2016-09-13 18:33:45 +00:00
|
|
|
Documentation
|
2016-08-25 17:06:01 +00:00
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2016-10-26 20:19:18 +00:00
|
|
|
<pre className="selectable pad force-word-wrap">
|
2016-08-25 17:06:01 +00:00
|
|
|
{error}
|
2016-09-28 21:17:57 +00:00
|
|
|
</pre>
|
2016-08-25 17:06:01 +00:00
|
|
|
<hr/>
|
|
|
|
<div className="text-center pad">
|
|
|
|
<p className="faint pad-left pad-right">
|
2016-09-13 18:33:45 +00:00
|
|
|
Here are some additional things that may help.
|
2016-08-25 17:06:01 +00:00
|
|
|
</p>
|
|
|
|
{msg}
|
|
|
|
|
|
|
|
<Link button={true} className="btn btn--super-compact btn--outlined margin-top-sm"
|
2016-11-23 19:33:24 +00:00
|
|
|
href="https://insomnia.rest/documentation/support-and-feedback/">
|
2016-08-25 17:06:01 +00:00
|
|
|
Contact Support
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ResponseError.propTypes = {
|
|
|
|
error: PropTypes.string.isRequired,
|
|
|
|
url: PropTypes.string.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ResponseError;
|
|
|
|
|