001/* 002 * Copyright 2011 Marc Wick, geonames.org 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 */ 017package org.geonames; 018 019/** 020 * @author marc 021 * @since 20.01.2011 022 * 023 */ 024public class GeoNamesException extends Exception { 025 026 private static final long serialVersionUID = 746586385626445380L; 027 private String message; 028 private int exceptionCode; 029 030 public GeoNamesException(int exceptionCode, String msg) { 031 super(msg); 032 this.message = msg; 033 this.exceptionCode = exceptionCode; 034 } 035 036 public GeoNamesException(String msg) { 037 super(msg); 038 this.message=msg; 039 } 040 041 /** 042 * @return the message 043 */ 044 public String getMessage() { 045 return message; 046 } 047 048 /** 049 * @return the exceptionCode 050 */ 051 public int getExceptionCode() { 052 return exceptionCode; 053 } 054 055}