/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

exception Exception1 {
}

exception Exception2 {
}

// This is a special case, we want to make sure that the middleware don't
// accidentally pull result as error.
struct/*exception*/ FooResponse {      // returning an exception by any means other than "throws" is illegal
}

service ClientMiddlewareExceptionTest {
  FooResponse foo() throws(            // returning an exception by any means other than "throws" is illegal
      1: Exception1 error1,
      2: Exception2 error2,
  )
}
