Code Monkey home page Code Monkey logo

better-error-pages-spring-boot-starter's Introduction

Better Error Pages

Introduction

Build status jitpack

This is a Spring Boot Starter project which provides Rails like error pages for Spring Boot applications for development environments.

Screenshot

For rest requests, any error is archived until a configurable timeout and the error page url is sent in rest request’s response headers.

Screenshot
Screenshot

Demo

Note that demo page is a Heroku app so it may be sleeping when you first open the page, it may take 1-2 min for server to wake up.

Quick Start

Just add the dependency to your maven/gradle of your Spring Boot application then it will autoconfigure itself and Better Error Pages will be available if your active profiles includes dev or development.

Adding the dependency to your project

<dependencies>
  <dependency>
    <groupId>com.github.kodgemisi</groupId>
    <artifactId>better-error-pages-spring-boot-starter</artifactId>
    <version>${better-error-pages-spring-boot-starter.version}</version>
  </dependency>
</dependencies>

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

See https://jitpack.io/#kodgemisi/better-error-pages-spring-boot-starter for Jitpack usage, dependency details, version info and Gradle usage.

Configuration

Better Error Pages;

  • sets server.error.include-stacktrace: always and server.error.include-exception: true automatically.

  • autoconfigures itself if active profile has dev or development however you can override this via better-error-pages.profiles property.

  • finds your @SpringBootApplication annotated class and use its package name as better-error-pages.package-name name however you can override this via better-error-pages.package-name property.

Tip
Note that package-name should be typically your own base package which is used throughout your own classes like com.yourcompany.
better-error-pages:
  package-name: <String> # A package name whose classes' source code will be parsed and displayed in error pages.
  profiles: <String or List of string> # Override default profiles to enable Better Error Pages. Default value: "dev, development"
Important
Setting better-error-pages.package-name property improves startup performance significantly but won’t affect runtime performance.
Warning

If you set better-error-pages.package-name property then your project must have one of following files:

  • application.yml

  • application-dev.yml

  • application.properties

  • application-dev.properties

Limitations

  • Won’t work for package names containing upper case characters.

  • Can’t show source code in multi module projects only if the project is run as packaged but other features will work.

    • When running multi module projects from an IDE everything just works.

License

© Copyright 2018 Kod Gemisi Ltd.

Mozilla Public License 2.0 (MPL-2.0)

MPL is a copyleft license that is easy to comply with. You must make the source code for any of your changes available under MPL, but you can combine the MPL software with proprietary code, as long as you keep the MPL code in separate files. Version 2.0 is, by default, compatible with LGPL and GPL version 2 or greater. You can distribute binaries under a proprietary license, as long as you make the source available under MPL.

better-error-pages-spring-boot-starter's People

Contributors

destan avatar

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.