// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.hardwaresecuritymodules.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.management.exception.ManagementError;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The error exception. */
@Immutable
public final class Error extends ManagementError {
    /*
     * Contains more specific error that narrows down the cause. May be null.
     */
    @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY)
    private Error innerError;

    /**
     * Get the innerError property: Contains more specific error that narrows down the cause. May be null.
     *
     * @return the innerError value.
     */
    public Error getInnerError() {
        return this.innerError;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (getInnerError() != null) {
            getInnerError().validate();
        }
    }
}
