ErrorSystem - Design

Menu
on SourceForge
Forums
Mailing lists
Home
Design
Mail me

MySQL, SQLite

As McTails propose, and I agreed that, we should use a db system to store all datas using by ES. We planned to develop it first for MySQL, and, when PHP5 will be published, we planned to use SQLite also. The ES administrator should choice between one of those, regarding to his requirement. In both case, the tables' structure will be the same. The purpose of this page is to describ this structure. To simplify, we should talk about SQL for both.

Why MySQL ?

It is a well known db server, that many free web hosting providers allow.

Why SQlite ?

SQLite "is a C library that implements an embeddable SQL database engine". That means you don't need a SQL server to use SQL database, you access directly the files, without any other interface than the functions implemented in this library. No more thread, no more memory and all. SQLite is designed for embedded system. No risk of failed connection to a remote server. And you even could implement ES inside your software distribution (using php.exe), even it isn't the purpose.

ini file : ES.ini

Well, we can't store all information into SQL. Particulary, we have to putting out of it which db to use (SQLite or MySQL, and maybe others in the future). So, we should have at least two parameters : dbtyp for the type of db, and dbadress indicate where to find the db.
We should also store here the admin mail.
So this file should begin like this : dbtyp = MySQL
dbadress = localhost
adminmail = me@home

Maybe should indicate here the version number of ES? Should make sections? What other things can me put there?

Main table: ES-main

ES stores main information about all the systems it had to manage in one main table. One record for one system. The fields are :

  1. name : name of the system to manage
  2. adminmail : name of the managed system admin
  3. deflg : the default langage to use display error messages, using short code, like en for english, fr for french, and so on
  4. adlg : aditionnal langage to use, should be asked in the request to ES
  5. what else?

First table for the managed system : yoursystem-ini

This table will be used to store information about errors without considering the langage, and the message displayed to the final user. It is used to tell ES what special action to take when it receives an error message request. The fields are :

  1. errornum : error number, use to index
  2. errorname : well, error name, should be use by the special action
  3. specialmsg : the text of the message to use by the special action
  4. errorlevel : a number that indicates the action to take, see below for more
  5. internalCod : a number used by the managed system, just to allow the developpers to do what they want

Error levels

Error levels are use to describe special action that ES or the managed system should take when an error occured. You can add their values to combine : error level 3 combines error levels 1 and 2. Here is a list of the basic error levels :

  1. 0 : nothing to do
  2. 1 : stop the execution of the software
  3. 2 : the software mails a message to the internal user set
  4. 4 : the software sends a message to the system administrator (you)
  5. 8 : ES mails a message to the system administrator (you)
For the moment, this list is only a proposition. We have to discuss that point in the errorsystem-devel mailing list.

Message tables : yoursystem-lg

For each langage ES should manage for your system, it creates a table named yoursystem-lg, where lg indicates the langage. Fields are :

  1. errornum : number used as index
  2. errorname : in this langage
  3. shortdesc : a short description of the error
  4. longdesc : a long description of the error
  5. htmldesc : a description of the error in HTML format for direct display
I'm thinking about an XML description of the error, what do you think about it?


Last modified: Tue Dec 11 16:45:36 Paris, Madrid 2003