TrackManiaControl/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php

32 lines
866 B
PHP
Raw Normal View History

<?php
/**
* ManiaPlanet dedicated server Xml-RPC client
*
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/
namespace Maniaplanet\DedicatedServer\Xmlrpc;
class FaultException extends Exception
{
static function create($faultString, $faultCode)
{
switch($faultString)
{
case 'Login unknown.':
return new LoginUnknownException($faultString, $faultCode);
2014-04-19 22:44:59 +02:00
case 'Unable to write the playlist file.':
return new CouldNotWritePlaylistFileException($faultString, $faultCode);
case 'Start index out of bound.':
return new StartIndexOutOfBoundException($faultString, $faultCode);
}
return new self($faultString, $faultCode);
}
}
class LoginUnknownException extends FaultException {}
2014-04-19 22:44:59 +02:00
class CouldNotWritePlaylistFileException extends FaultException {}
class StartIndexOutOfBoundException extends FaultException {}
?>