Branch: Tag:

2004-09-20

2004-09-20 13:40:56 by Martin Stjernholm <mast@lysator.liu.se>

A slight modernization.

Rev: lib/modules/Search.pmod/Utils.pmod:1.44

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Utils.pmod,v 1.43 2004/08/25 12:05:28 js Exp $ + // $Id: Utils.pmod,v 1.44 2004/09/20 13:40:56 mast Exp $      #if !constant(report_error)   #define report_error werror
39:   }       - #define THROW(X) throw( ({ (X), backtrace() }) ) -  +    //! A result entry from the @[ProfileCache].   class ProfileEntry {   
102:    db = Search.Database.MySQL( DBManager.db_url( get_database_value("db_name"), 1) );   #endif    if(!db) -  THROW("Could not aquire the database URL to database " + +  error("Could not aquire the database URL to database " +    get_database_value("db_name") + ".\n");    }    return db;
154:    case "array": return indices(vals);    case "multiset": return (multiset)indices(vals);    default: -  THROW("Can not cast ADTSet to "+to+".\n"); +  error("Can not cast ADTSet to "+to+".\n");    }    }    }
197: Inside #if constant(DBManager)
  #if constant(DBManager)    db = DBManager.cached_get(db_name);   #endif -  if(!db) THROW("Could not connect to database " + db_name + ".\n"); +  if(!db) error("Could not connect to database " + db_name + ".\n");    return db;    }   
275:    array res = get_db()->    query("SELECT id FROM profile WHERE name=%s AND type=2", name);    if(!sizeof(res)) -  THROW("No database profile " + name + " found.\n"); +  error("No database profile " + name + " found.\n");       return db_profile_names[name] = (int)res[0]->id;    }
290:    array res = get_db()->    query("SELECT id FROM profile WHERE name=%s AND type=1", name);    if(!sizeof(res)) -  THROW("No query profile " + name + " found.\n"); +  error("No query profile " + name + " found.\n");       return query_profile_names[name] = (int)res[0]->id;    }