ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Error.php
Go to the documentation of this file.
1<?php
10//Language constant
11define('JAMALANG', 'EN');
12
13
14//All errors may be defined by the following format:
15//define('ExceptionName', N);
16//$error['lang'][ExceptionName] = 'Error message';
17$error = array();
18
19/*
20I've used Babelfish and a little poor knowledge of Romance/Germanic languages for the translations here.
21Feel free to correct anything that looks amiss to you.
22*/
23
24define('PolymorphicArgumentException', -1);
25$error['EN'][PolymorphicArgumentException] = "Invalid argument pattern for polymorphic function.";
26$error['FR'][PolymorphicArgumentException] = "Modèle inadmissible d'argument pour la fonction polymorphe.".
27$error['DE'][PolymorphicArgumentException] = "Unzulässiges Argumentmuster für polymorphe Funktion.";
28
29define('ArgumentTypeException', -2);
30$error['EN'][ArgumentTypeException] = "Invalid argument type.";
31$error['FR'][ArgumentTypeException] = "Type inadmissible d'argument.";
32$error['DE'][ArgumentTypeException] = "Unzulässige Argumentart.";
33
34define('ArgumentBoundsException', -3);
35$error['EN'][ArgumentBoundsException] = "Invalid argument range.";
36$error['FR'][ArgumentBoundsException] = "Gamme inadmissible d'argument.";
37$error['DE'][ArgumentBoundsException] = "Unzulässige Argumentstrecke.";
38
39define('MatrixDimensionException', -4);
40$error['EN'][MatrixDimensionException] = "Matrix dimensions are not equal.";
41$error['FR'][MatrixDimensionException] = "Les dimensions de Matrix ne sont pas égales.";
42$error['DE'][MatrixDimensionException] = "Matrixmaße sind nicht gleich.";
43
44define('PrecisionLossException', -5);
45$error['EN'][PrecisionLossException] = "Significant precision loss detected.";
46$error['FR'][PrecisionLossException] = "Perte significative de précision détectée.";
47$error['DE'][PrecisionLossException] = "Bedeutender Präzision Verlust ermittelte.";
48
49define('MatrixSPDException', -6);
50$error['EN'][MatrixSPDException] = "Can only perform operation on symmetric positive definite matrix.";
51$error['FR'][MatrixSPDException] = "Perte significative de précision détectée.";
52$error['DE'][MatrixSPDException] = "Bedeutender Präzision Verlust ermittelte.";
53
54define('MatrixSingularException', -7);
55$error['EN'][MatrixSingularException] = "Can only perform operation on singular matrix.";
56
57define('MatrixRankException', -8);
58$error['EN'][MatrixRankException] = "Can only perform operation on full-rank matrix.";
59
60define('ArrayLengthException', -9);
61$error['EN'][ArrayLengthException] = "Array length must be a multiple of m.";
62
63define('RowLengthException', -10);
64$error['EN'][RowLengthException] = "All rows must have the same length.";
65
70function JAMAError($errorNumber = null) {
71 global $error;
72
73 if (isset($errorNumber)) {
74 if (isset($error[JAMALANG][$errorNumber])) {
75 return $error[JAMALANG][$errorNumber];
76 } else {
77 return $error['EN'][$errorNumber];
78 }
79 } else {
80 return ("Invalid argument to JAMAError()");
81 }
82}
const MatrixSingularException
Definition: Error.php:54
const MatrixDimensionException
Definition: Error.php:39
const RowLengthException
Definition: Error.php:63
const PrecisionLossException
Definition: Error.php:44
const PolymorphicArgumentException
Definition: Error.php:24
const ArrayLengthException
Definition: Error.php:60
const MatrixSPDException
Definition: Error.php:49
const MatrixRankException
Definition: Error.php:57
const ArgumentTypeException
Definition: Error.php:29
const ArgumentBoundsException
Definition: Error.php:34
$error
Definition: Error.php:17
const JAMALANG
Definition: Error.php:11
JAMAError($errorNumber=null)
Custom error handler.
Definition: Error.php:70
An exception for terminatinating execution or to throw for unit testing.