Mercurial > projects > mde
comparison mde/mergetag/Reader.d @ 24:32eff0e01c05
Only locally-changed options are stored in user-config now. Log levels revised.
Options sub-classes are handled more generically and can be added without changing the Options class.
Options changed at run-time are tracked, and on exit merged with user options and saved.
Revised log levels as set out in policies.txt and as used in code.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 27 Mar 2008 16:15:21 +0000 |
parents | 5f90774ea1ef |
children | 611f7b9063c6 |
comparison
equal
deleted
inserted
replaced
23:47478557428d | 24:32eff0e01c05 |
---|---|
233 throwMTErr ("Error reading file: " ~ e.msg, new MTFileIOException); | 233 throwMTErr ("Error reading file: " ~ e.msg, new MTFileIOException); |
234 } | 234 } |
235 // Remember the file name so that we can report errors (somewhat) informatively: | 235 // Remember the file name so that we can report errors (somewhat) informatively: |
236 ErrFile = path.path ~ path.file; | 236 ErrFile = path.path ~ path.file; |
237 ErrInFile = " in \"" ~ ErrFile ~ '"'; | 237 ErrInFile = " in \"" ~ ErrFile ~ '"'; |
238 | 238 |
239 // Version checking & matching header section tag: | 239 // Version checking & matching header section tag: |
240 if (fbuf.length < 6 || fbuf[0] != '{' || fbuf[1] != 'M' || fbuf[2] != 'T' || fbuf[5] != '}') | 240 if (fbuf.length < 6 || fbuf[0] != '{' || fbuf[1] != 'M' || fbuf[2] != 'T' || fbuf[5] != '}') |
241 throwMTErr("Not a valid MergeTag text file" ~ ErrInFile, new MTFileFormatException); | 241 throwMTErr("Not a valid MergeTag text file" ~ ErrInFile, new MTFileFormatException); |
242 fileVer = MTFormatVersion.parseString (fbuf[3..5]); | 242 fileVer = MTFormatVersion.parseString (fbuf[3..5]); |
243 if (fileVer == MTFormatVersion.VERS.INVALID) | 243 if (fileVer == MTFormatVersion.VERS.INVALID) |
429 type = Util.trim(type); | 429 type = Util.trim(type); |
430 try { | 430 try { |
431 dsec.addTag (type, tagID, data); | 431 dsec.addTag (type, tagID, data); |
432 } | 432 } |
433 catch (TextException e) { | 433 catch (TextException e) { |
434 logger.warn ("TextException while reading " ~ ErrFile ~ ":"); // following a parse error | 434 logger.error ("TextException while reading " ~ ErrFile ~ ":"); // following a parse error |
435 logger.warn (e.msg); | 435 logger.error (e.msg); |
436 } | 436 } |
437 catch (Exception e) { | 437 catch (Exception e) { |
438 logger.error ("Unknown error occured" ~ ErrInFile ~ ':'); | 438 logger.error ("Unknown error occured" ~ ErrInFile ~ ':'); |
439 logger.error (e.msg); | 439 logger.error (e.msg); |
440 throwMTErr (e.msg); // Fatal to Reader | 440 throwMTErr (e.msg); // Fatal to Reader |