mirror of
https://github.com/status-im/burnchart.git
synced 2025-02-09 09:03:52 +00:00
handle request errors with redirects; closes #119
This commit is contained in:
parent
c86affcb73
commit
1f339070e9
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "burnchart",
|
"name": "burnchart",
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"description": "GitHub Burndown Chart as a Service",
|
"description": "GitHub Burndown Chart as a Service",
|
||||||
"author": "Radek Stepan <dev@radekstepan.com> (http://radekstepan.com)",
|
"author": "Radek Stepan <dev@radekstepan.com> (http://radekstepan.com)",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
|
File diff suppressed because one or more lines are too long
4
public/js/bundle.min.js
vendored
4
public/js/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
@ -17,7 +17,7 @@ superagent.parse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Default args.
|
// Default args.
|
||||||
let defaults = {
|
const defaults = {
|
||||||
'github': {
|
'github': {
|
||||||
'host': 'api.github.com',
|
'host': 'api.github.com',
|
||||||
'protocol': 'https'
|
'protocol': 'https'
|
||||||
@ -128,7 +128,7 @@ let request = ({ protocol, host, path, query, headers }, cb) => {
|
|||||||
|
|
||||||
// How do we respond to a response?
|
// How do we respond to a response?
|
||||||
let response = (err, data, cb) => {
|
let response = (err, data, cb) => {
|
||||||
if (err) return cb(error(data.body || err));
|
if (err) return cb(error(data ? data.body : err));
|
||||||
// 2xx?
|
// 2xx?
|
||||||
if (data.statusType !== 2) return cb(error(data.body));
|
if (data.statusType !== 2) return cb(error(data.body));
|
||||||
// All good.
|
// All good.
|
||||||
|
@ -112,7 +112,7 @@ class ProjectsStore extends Store {
|
|||||||
onProjectsDemo() {
|
onProjectsDemo() {
|
||||||
this.set({
|
this.set({
|
||||||
'list': [
|
'list': [
|
||||||
{ 'owner': 'mbostock', 'name': 'd3' },
|
{ 'owner': 'd3', 'name': 'd3' },
|
||||||
{ 'owner': 'radekstepan', 'name': 'disposable' },
|
{ 'owner': 'radekstepan', 'name': 'disposable' },
|
||||||
{ 'owner': 'rails', 'name': 'rails' }
|
{ 'owner': 'rails', 'name': 'rails' }
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user