Garen
Garen

Reputation: 30

what is the best way to debug and find errors in a total.js app like the eshop provided on their website?

I have been following everything the total.js documentations have to offer to be able to work with the eshop project. however, sometimes i get errors and the only thing i see is 404 on the browser whether the error is from api or frontend or routing, so at this point, tracing errors feels virtually impossible and taking too much time.

is there any way i can get comprehensive error messages to be able to figure out what went wrong or which file to look at?

Upvotes: 0

Views: 55

Answers (1)

Peter Sirka
Peter Sirka

Reputation: 748

You have several possibilities how to debug:

  • you can add your custom logs
  • check output logs
  • or catch 404 errors globally:
// The route will be evaluated if the page won't exist
ROUTE('#404', function() {
    var self = this;

    // Here you can found info about the URL
    console.log(404, self.url);

    self.status = 404;
    self.plain('404: Page not found');
});

Upvotes: 1

Related Questions