ServerException.php

Summary
ServerException.php
ServerExceptionClass for server-side exceptions in postActiv
ServerExceptionSubclass of PHP Exception for server errors.
__constructConstructor for the exception, which by default will log the exception even if otherwise it’s caught.
__toStringReturn a string representation of the exception.
AlreadyFulfilledExceptionClass for an exception when trying to do something that was probably already done.
UnsupportedMediaExceptionClass for a server exception caused by handling an unsupported media type, typically through an attachment/file upload.
UseFileAsThumbnailExceptionA specific variant of UnsupportedMediaException where we do not have a thumbnail generated for the given file.

ServerException

Class for server-side exceptions in postActiv

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

ServerException and descendant classes as well as the canonical error definitions

These classes represent various internal server errors that ususally are not fixable by the end user.

PHP version

Tested with PHP 7

File Authors

Web

ServerException

Subclass of PHP Exception for server errors.  The user typically can’t fix these.

Summary
__constructConstructor for the exception, which by default will log the exception even if otherwise it’s caught.
__toStringReturn a string representation of the exception.

__construct

public function __construct( $message =  null,
 $code =  SERVER_EXCEPTION,
Exception $previous =  null,
 $severity =  LOG_ERR)

Constructor for the exception, which by default will log the exception even if otherwise it’s caught.

__toString

public function __toString()

Return a string representation of the exception.

AlreadyFulfilledException

Class for an exception when trying to do something that was probably already done.

This is a common case for example when remote sites are not up to date with our database.  For example subscriptions, where a remote user may be unsubscribed from our user, but they request it anyway.

This exception should be caught in a manner that lets the execution continue as if the desired action did what it was supposed to do.

UnsupportedMediaException

Class for a server exception caused by handling an unsupported media type, typically through an attachment/file upload.

UseFileAsThumbnailException

A specific variant of UnsupportedMediaException where we do not have a thumbnail generated for the given file.

public function __construct( $message =  null,
 $code =  SERVER_EXCEPTION,
Exception $previous =  null,
 $severity =  LOG_ERR)
Constructor for the exception, which by default will log the exception even if otherwise it’s caught.
public function __toString()
Return a string representation of the exception.