source: sourcecode/application/libraries/PHPExcel/Shared/JAMA/utils/Error.php @ 1

Last change on this file since 1 was 1, checked in by dungnv, 11 years ago
File size: 3.0 KB
Line 
1<?php
2/**
3 *      @package JAMA
4 *
5 *      Error handling
6 *      @author Michael Bommarito
7 *      @version 01292005
8 */
9
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
66/**
67 *      Custom error handler
68 *      @param int $num Error number
69 */
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}
Note: See TracBrowser for help on using the repository browser.