Git Product home page Git Product logo

Comments (4)

Anthodpnt avatar Anthodpnt commented on August 9, 2024

Hi @TristanPct ,

We are currently working on the v2.0 of Highway...

We have add a new method called location to Highway.Core that'll give you the ability to redirect to a page like you would do with window.location but using Highway.

So I would say that since the NAVIGATE_ERROR event gives you acces to the HTTP/Request status, you'll be able to know the status code and use this method to redirect to the right error page using this new method. What do you think ?

Cheers,
Anthodpnt

from highway.

TristanPct avatar TristanPct commented on August 9, 2024

👍 This method could be usefull, for this case or others.

But with this technique the browser load the error page twice (for the NAVIGATE_ERROR and for the location method).

Perhaps a method or parameter in the NAVIGATE_ERROR event telling continue anyway (like event.continueRouting() for example) could avoid this double page load.

from highway.

Anthodpnt avatar Anthodpnt commented on August 9, 2024

@TristanPct I understand what you mean and we'll look into a cleaner solution as soon as possible.

from highway.

Anthodpnt avatar Anthodpnt commented on August 9, 2024

@TristanPct We juste released the v2.0.0 of Highway that will fix your issue. Since we cannot predict that there will be an error or that an error page is provided we have to hard reload the page as soon as the response.status of the HTTPRequest is outside the 200-299 range.

Best regards,
Anthodpnt

from highway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.