/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */
package org.elasticsearch.license.plugin.core;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.rest.RestStatus;

/**
 * Exception to be thrown when a feature action requires a valid license
 */
public class LicenseExpiredException extends ElasticsearchException {

    public LicenseExpiredException(String feature) {
        super("license expired for feature [" + feature + "]");
    }

    @Override
    public RestStatus status() {
        return RestStatus.UNAUTHORIZED;
    }
}

@@ -527,16 +527,51 @@
 tion %7B%0A%0A
+    private final String feature;%0A%0A
     publ
@@ -611,24 +611,24 @@
  feature) %7B%0A
-
         supe
@@ -679,16 +679,48 @@
 + %22%5D%22);%0A
+        this.feature = feature;%0A
     %7D%0A%0A 
@@ -761,24 +761,24 @@
  status() %7B%0A
-
         retu
@@ -810,11 +810,72 @@
 D;%0A    %7D
+%0A%0A    public String feature() %7B%0A        return feature;%0A    %7D
 %0A%7D%0A

Add feature getter on LicenseExpiredException