Code Monkey home page Code Monkey logo

client_error_trace's Introduction

Client Error Trace

A Drupal module to help track down HTTP 4XX client errors.

Requirements

Installation and Use

Enable the module, being sure to let Composer Manager update libraries if required. Browse to Admin / Reports / Client Error Trace, and use the form to run tests on any problematic URLs.

Included Plugins

  • Access Content: Checks that users have the access content permission on node URLs.

Writing Client Error Plugins

This module uses a backport of the Drupal 8 plugin system to let other modules add traces for debugging client errors. For example, many sites have custom CDN or caching configurations. By writing a custom module with plugins for each system to check, it is possible for Client Error Trace to provide detailed reports.

Examples and Documentation

  • Drupal 8 Plugins Explained.
  • The "Access Content" plugin included with this module is a good starting point to learn how to add your own plugins to your own custom modules.
  • plug_example is also an excellent guide to the Drupal 8 plugin system.

Steps for a new plugin

  1. In your module, create a src/Plugin/client_error directory.
  2. Create a new class in that directory that extends ClientErrorBase and implements ClientErrorInterface.
  3. Annotate the class with the @ClientError annotation containing:
    • An id property, with the name of your plugin in underscore format.
    • A plain-text description property describing your plugin.
    • An integer status_code property describing what HTTP error code your plugin assists in debugging. This will generally be 403 or 404.
  4. Create a new class that extends ReportBase and implements ReportInterface to use for reporting the results of your client error plugin. Return a new instance of this class from your execute() method.
  5. Clear all caches.
  6. Browse to admin/reports/client-error, and your new plugin should be listed.

client_error_trace's People

Contributors

deviantintegral avatar

Watchers

 avatar  avatar  avatar

client_error_trace's Issues

Project includes insecure guzzlehttp/guzzle as dependency

Note: The Drupal security team have made the determination that this issue can be fixed because there is no stable release of this project which is why this issue was created here.

As part of the httpoxy vulnerability, this module includes an affected version of guzzlehttp/guzzle package as a dependency:

http://cgit.drupalcode.org/client_error_trace/tree/composer.json?h=7.x-1.x#n13

The guzzlehttp/guzzle dependency should be updated to 6.2.1 to address this issue.

Add a plugin to support basic HTTP requests

We should add a plugin to support an HTTP request against the provided URL, as well as custom derivatives such as Varnish servers, CDNs, and so on. Let's use Guzzle since it would let us fork off multiple requests and gather them at the end.

I'm not sure the best way to handle this, in that there might be a way with plugin instances to do this cleanly, or we might just want to use a simple settings form.

Add a plugin to check the cache_page bin

If a page is cached by Drupal's page cache, it will be stored in cache_page in MySQL or memcache. We should check the result there to see if we've cached a 4XX.

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.