Branch: Tag:

2002-06-17

2002-06-17 09:36:34 by Anders Johansson <anders@roxen.com>

Implemented some error handling in try_get_file() and load_layers() in order to solve [bug 2410 (#2410)].

Rev: server/base_server/configuration.pike:1.520
Rev: server/base_server/prototypes.pike:1.51
Rev: server/base_server/roxen.pike:1.797
Rev: server/etc/modules/LazyImage.pmod/module.pmod:1.7
Rev: server/modules/graphics/cimg.pike:1.50
Rev: server/modules/graphics/gbutton.pike:1.95

5:   // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.519 2002/06/10 16:57:04 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.520 2002/06/17 09:36:32 anders Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
2252:      int|string try_get_file(string s, RequestID id,    int|void status, int|void nocache, -  int|void not_internal) +  int|void not_internal, +  mapping|void result_mapping)   //! Convenience function used in quite a lot of modules. Tries to read   //! a file into memory, and then returns the resulting string.   //!
2321:    return 0;    }    +  if (result_mapping) +  foreach(indices(m), string i) +  result_mapping[i] = m[i]; +     // Allow 2* and 3* error codes, not only a few specific ones.    if (!(< 0,2,3 >)[m->error/100]) return 0;