Overview
Namespace:FQL\Exception
All FiQueLa exceptions extend either a standard PHP exception class or FQL\Exception\Exception (which itself extends \Exception). You can catch them by specific type or use the base classes to catch groups.
Base exception
Exception
File and I/O exceptions
FileNotFoundException
fromFile(), open(), or any stream factory cannot be found on the filesystem or is not readable.
Thrown by: Stream\Provider::fromFile(), Query\Provider::fromFile(), Csv::open(), and all other stream open() methods.
FileAlreadyExistsException
UnableOpenFileException
FileQueryException
fromFileQuery() and into()) is malformed or references a missing target file.
Thrown by: ResultsProvider::into(), Query\Provider::fromFileQuery().
Format and argument exceptions
InvalidFormatException
fromString() is called with an unsupported format. Also thrown for invalid CSV parameters (bad delimiter, unsupported encoding, etc.).
Thrown by: Format::fromExtension(), Stream\Provider::fromFile(), Stream\Provider::fromString(), Format::fromString().
InvalidArgumentException
Operator::fromOrFail(), or providing a non-scalar BETWEEN range.
UnexpectedValueException
WHERE or HAVING conditions.
Query construction exceptions
These exceptions are thrown during query building (beforeexecute() is called).
QueryLogicException
- Using
DISTINCTtogether withGROUP BY. - Using
GROUP BYtogether withDISTINCT. - Using
UNIONwith mismatched column counts between the main query and a union query.
SelectException
SELECT:. Thrown when:
- A field is selected more than once with
select(). - A
modulo()division produces an unexpected value.
AliasException
AS:. Thrown when as() is called with:
- An empty alias string.
- An alias that is already used.
- No preceding selected field to alias.
- A field that was already aliased.
JoinException
JOIN:. Thrown when:
- A join is added with an empty alias.
on()is called without a preceding join.
OrderByException
ORDER BY:. Thrown when:
- The same field is added to
orderBy()twice. asc()ordesc()is called when no ordering has been set.
SortException
ORDER BY:. Thrown by the sort execution phase when an unexpected error occurs while sorting the result set.
CaseException
CASE:. Thrown when the CASE expression builder methods are called out of order:
whenCase()without a precedingcase().elseCase()without a precedingcase()orwhenCase().elseCase()called twice.endCase()without a precedingcase().
Runtime exceptions
NotImplementedException
callable and generates a descriptive message like "Static method FQL\Stream\Csv::string not implemented yet."
Currently thrown by Csv::string() (creating a CSV stream from a string is not supported).