mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
introduce ProtocolException
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@807 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
6756794c66
commit
c8fbfd3112
2 changed files with 50 additions and 1 deletions
|
@ -58,6 +58,7 @@ import de.schildbach.pte.dto.ResultHeader;
|
||||||
import de.schildbach.pte.dto.StationDepartures;
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.dto.Stop;
|
import de.schildbach.pte.dto.Stop;
|
||||||
import de.schildbach.pte.exception.ParserException;
|
import de.schildbach.pte.exception.ParserException;
|
||||||
|
import de.schildbach.pte.exception.ProtocolException;
|
||||||
import de.schildbach.pte.exception.SessionExpiredException;
|
import de.schildbach.pte.exception.SessionExpiredException;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
import de.schildbach.pte.util.XmlPullUtil;
|
import de.schildbach.pte.util.XmlPullUtil;
|
||||||
|
@ -2171,7 +2172,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
pp.next();
|
pp.next();
|
||||||
|
|
||||||
if (XmlPullUtil.test(pp, "html"))
|
if (XmlPullUtil.test(pp, "html"))
|
||||||
throw new IllegalStateException("html");
|
throw new ProtocolException("html");
|
||||||
|
|
||||||
XmlPullUtil.require(pp, "itdRequest");
|
XmlPullUtil.require(pp, "itdRequest");
|
||||||
|
|
||||||
|
|
48
src/de/schildbach/pte/exception/ProtocolException.java
Normal file
48
src/de/schildbach/pte/exception/ProtocolException.java
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010, 2011 the original author or authors.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.schildbach.pte.exception;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andreas Schildbach
|
||||||
|
*/
|
||||||
|
public class ProtocolException extends IOException
|
||||||
|
{
|
||||||
|
public ProtocolException()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProtocolException(final String message)
|
||||||
|
{
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProtocolException(final String message, final Throwable cause)
|
||||||
|
{
|
||||||
|
super(message);
|
||||||
|
super.initCause(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProtocolException(final Throwable cause)
|
||||||
|
{
|
||||||
|
super(cause == null ? null : cause.toString());
|
||||||
|
super.initCause(cause);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue