package com.mitchellbosecke.pebble.boot.autoconfigure;

import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertyResolver;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.ClassUtils;

public class PebbleTemplateAvailabilityProvider implements TemplateAvailabilityProvider {

    @Override
    public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader,
            ResourceLoader resourceLoader) {
        if (ClassUtils.isPresent("com.mitchellbosecke.pebble.PebbleEngine", classLoader)) {
            PropertyResolver resolver = new RelaxedPropertyResolver(environment, "pebble.");
            String prefix = resolver.getProperty("prefix", PebbleProperties.DEFAULT_PREFIX);
            String suffix = resolver.getProperty("suffix", PebbleProperties.DEFAULT_SUFFIX);
            return resourceLoader.getResource(prefix + view + suffix).exists();
        } else {
            return false;
        }
    }

}
@@ -1064,16 +1064,54 @@
 esource(
+ResourceLoader.CLASSPATH_URL_PREFIX + 
 prefix +
@@ -1197,8 +1197,9 @@
     %7D%0A%0A%7D
+%0A

Fix issue with loading error templates for specific error codes.