valerii.f
valerii.f
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
it doesn't seems to be working for me 😦 bellow is my middleware.config.js file server restarted after updating the file. @bartoszherba Could you please point me where am I wrong ?
module.exports = {
integrations: {
companyIntegrationName: {
location: "./api-client/server",
configuration: {
/// CONFIGURATION...
},
errorHandler: (error) => {
console.log(error)
}, // here goes your logger
},
},
};
module.exports = {
integrations: {
companyIntegrationName: {
location: "./api-client/server",
configuration: {
/// CONFIGURATION...
},
errorHandler: (error) => {
console.log(error)
}, // here goes your logger
},
},
};
Thanks!
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
Hey @bartoszherba , thanks for the update. could you please clarify - what do you mean or add your error handler ? Where exactly can I add this handler?
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
and I see in Chrome Network tab - my expected error, but not in the .catch method of the SDK response 🙂
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
that is why I am asking.. how should I handle errors normally ? - I handle errors on api-client endpoint method - on sdk endpoint method but when I catch error in Next.js app - I can't see the message - which actuatlly sends our API, but SDKError: Request failed with status code 400 🙂
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
but I am getting
SDKError: Request failed with status code 400
at handleError (index.es.js:64:1)
at Object.eval [as generateCustomerToken] (index.es.js:259:1)
SDKError: Request failed with status code 400
at handleError (index.es.js:64:1)
at Object.eval [as generateCustomerToken] (index.es.js:259:1)
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
expected behaviour would be to get Error I send from api-client endpoint - as I am catching it there.. something like that :
{ 13:38:45
name: 'Customer not found',
code: 'COR-001',
detail: 'Customer with tenant: ClientName and login: [email protected] not found'
}
{ 13:38:45
name: 'Customer not found',
code: 'COR-001',
detail: 'Customer with tenant: ClientName and login: [email protected] not found'
}
43 replies
AAlokai
Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
hm. it seems i'm not following, sorry
43 replies
AAlokai
Created by valerii.f on 12/20/2023 in #🙋|general-help
Deploy Vuestorefront with Docker
One more thing, maybe you can answer or point to documentation: All endpoints we create in integration using POST method. Is there a way to change it to GET ?
export async function exampleMethod(props: TODO) {
const { data } = await client.post<TODO>('exampleEndpoint', props);
return data
}
export async function exampleMethod(props: TODO) {
const { data } = await client.post<TODO>('exampleEndpoint', props);
return data
}
I need an endpoint to be await client.get , but when I change it, the app crashes with error SDKError: Request failed with status code 404
6 replies
AAlokai
Created by valerii.f on 12/20/2023 in #🙋|general-help
Deploy Vuestorefront with Docker
omg.. that is so true.. Thank you @skirianov !
6 replies
AAlokai
Created by valerii.f on 11/20/2023 in #🙋|general-help
Problems using Custom Integration
OK, the problem was that I didn't include all built files from api-client folder
9 replies
AAlokai
Created by valerii.f on 11/20/2023 in #🙋|general-help
Problems using Custom Integration
Same, starting with this project 🙂 and having problems 🙂
9 replies
AAlokai
Created by valerii.f on 11/20/2023 in #🙋|general-help
Problems using Custom Integration
@Fabrice Reynaud thanks, but I am not sure I understand everything 🙂 could you please clarify this "use yarn link" ? I thought building the Integration - i should get everything I need to be able to use in ANY frontend framework 🙂 but this ERROR Cannot find module '@vue-storefront/integration-boilerplate-api/server' doesn't give me this impression anymore 😦
9 replies