npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

laravel-vue-whoops

v0.2.5

Published

A visualiser based on the Whoops error handler in Laravel for easy debugging of error exceptions and dumps for ajax calls using a VUE Component.

Downloads

15

Readme

About Vue Whoops Debug Component

Vue 2 ajax debug component for Laravel 5.5+ Vue based projects, pretty print Whoops style handler for ajax error responses in Laravel, auto handles error exceptions and Die Dump responses from ajax requests in a reactive display.

Features live debug mode for quick iteration through errors and dumps.

Works with Laravel Debug Bar, Debug Bar will continue to display over the top of this whoops handler view.

On demand or automatic retries of your last ajax request with the previous posted data.

Optional on success callback to resume any normal application function when request is free of errors or dump responses.

Video Demo

Installation

npm install laravel-vue-whoops

Adding Whoops VUE Component

Add Whoops Vue component to your applications js file after Vue is declared.

require('laravel-vue-whoops');

Example app.js:

window.Vue = require('vue');

require('laravel-vue-whoops');

new Vue({
  el: '#app',
    components: {
      'myComponent': require('./components/myComponent.vue'),
    },
    data: function() {
      return {}
    }
});

How to use

The Whoops.handle method takes two parameters.

Error

The error handle object parameter.

Callback

An optional custom error callback handler fallback. If the error response is not an exception or dump then your callback should be your custom client facing UX handler, typically this would be your custom handler for laravel validation UX responses or if APP DEBUG is disabled the custom callback would would called.

axios.patch(url,data).then(response => {

  // your public success handler here

}).catch(error => {

  Whoops.handle(error, function() {

    // your public fail handler here
    alert('Hello Guest, Sorry but the server encountered an Internal Server Error during the processing of your request!');

  });

});

Issue Tracking

https://github.com/marcnewton/laravel-whoops-vue-component/issues

FAQ

How do I open the debugger overlay?

The overlay will automatically present it's self if an Exception or Dump response is detected else your custom callback will execute if one is specified.

Troubleshooting If you believe the condition has been met for the debugger to display you should check the following:

  • z-index on div#whoops-app is not competing against the z-index of your application or 3rd party tools (except Laravel Debug Bar).
  • Check the console for any errors such as webpack compilation errors, Seek support if needed (see Support lower down)
What is the use case of the custom callback?

When Laravel's environment is set to production where debugging should be disabled, The VUE Whoops handler should no longer detect any exception errors, therefore should only call your custom callback function. This callback function should be a response handler that you would want your end users to see, like a custom error popup box.

Support

Twitter: @MarcANewton #laravueoops

Stack Overflow: @marc-newton