package com.github.mustachejava;

/* JADX INFO: loaded from: classes.dex */
public class MustacheException extends RuntimeException {
    private TemplateContext context;

    public MustacheException() {
    }

    public MustacheException(String str) {
        super(str);
    }

    public MustacheException(String str, Throwable th) {
        super(str, th);
    }

    public MustacheException(String str, Throwable th, TemplateContext templateContext) {
        super(str, th);
        this.context = templateContext;
    }

    public MustacheException(Throwable th) {
        super(th);
    }

    public MustacheException(String str, TemplateContext templateContext) {
        super(str);
        this.context = templateContext;
    }

    public MustacheException(Exception exc, TemplateContext templateContext) {
        super(exc);
        this.context = templateContext;
    }

    @Override // java.lang.Throwable
    public String getMessage() {
        return this.context == null ? super.getMessage() : super.getMessage() + " @" + this.context;
    }

    public void setContext(TemplateContext templateContext) {
        if (this.context == null) {
            this.context = templateContext;
        }
    }

    public TemplateContext getContext() {
        return this.context;
    }
}
