Add Generic ExpiredLicenseException
closes elastic/elasticsearch#5 Original commit: elastic/x-pack-elasticsearch@712e40214a
This commit is contained in:
parent
039cf21180
commit
b606be83f2
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* 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 ExpiredLicenseException extends ElasticsearchException {
|
||||||
|
|
||||||
|
public ExpiredLicenseException(String feature) {
|
||||||
|
super(feature + " license has expired");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestStatus status() {
|
||||||
|
return RestStatus.UNAUTHORIZED;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue