Comments (3)
Per #1 , can you give that a try let me know if that resolves this issue?
from buttercms-js.
@rogerjin12 I tested, and I see, that this case still doesn't work.
my code:
this.butter.post.list({ page: pageNumber, page_size: pageSize }).then(
(response) => {
clearTimeout(this.butterErrorTimeout); // timeout bugfix
let newState = {};
if (response.status === 200) {
newState = {
posts: response.data.data,
pagination: response.data.meta,
currentPage: pageNumber,
};
}
newState = {
...newState,
loading: false,
};
this.setState(newState);
}
);
So, how i see, that it should work:
- Fetch posts
- Request cancelled by timeout
- .then callback called with appropriate status and statusMessage (but on this step nothing called or returned)
from buttercms-js.
@vik-buchinski-azati Hi Victor. I investigated this and an error is returned. You need to catch it as part of the promise callback chain. Try this:
var butter = require('buttercms')('your api token', true, 1);
butter.post.list({page: 1, page_size: 10})
.then(function(response) {
console.log(response.data)
}).catch(function(response) {
console.log('this is an error', response)
});
from buttercms-js.
Related Issues (16)
- Required 1.0.16 with ability to setup timeout. HOT 2
- Type declaration file HOT 4
- Typescript build error in butter.d.ts HOT 4
- TypeError wrapping returned promise to observable HOT 2
- Create npm release for lastest master HOT 1
- Potential security issue HOT 2
- Pages list always returns an empty array HOT 1
- Changelog? HOT 4
- missing git tags HOT 2
- Bug - axios.create is not a function HOT 1
- NPM community repository is missing version 1.2.11 HOT 3
- Pagination issue HOT 2
- my params are being converted HOT 4
- how cancel request when get post list HOT 5
- how get posts with category? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buttercms-js.