|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +#include "parquet/exception.h" |
| 19 | + |
| 20 | +#include <exception> |
| 21 | +#include <sstream> |
| 22 | +#include <string> |
| 23 | + |
| 24 | +namespace parquet { |
| 25 | + |
| 26 | +void ParquetException::EofException() { |
| 27 | + throw ParquetException("Unexpected end of stream."); |
| 28 | +} |
| 29 | + |
| 30 | +void ParquetException::NYI(const std::string& msg) { |
| 31 | + std::stringstream ss; |
| 32 | + ss << "Not yet implemented: " << msg << "."; |
| 33 | + throw ParquetException(ss.str()); |
| 34 | +} |
| 35 | + |
| 36 | +ParquetException::ParquetException(const char* msg) : msg_(msg) {} |
| 37 | + |
| 38 | +ParquetException::ParquetException(const std::string& msg) : msg_(msg) {} |
| 39 | + |
| 40 | +ParquetException::ParquetException(const char* msg, std::exception& e) : msg_(msg) {} |
| 41 | + |
| 42 | +ParquetException::~ParquetException() throw() {} |
| 43 | + |
| 44 | +const char* ParquetException::what() const throw() { |
| 45 | + return msg_.c_str(); |
| 46 | +} |
| 47 | + |
| 48 | +} // namespace parquet |
0 commit comments