thanks for the reply!
i was hoping more for some heuristic advice...e.g., 'define a global array or object and write function so-and-so'. also, i am looking for something that isn't just for debugging, but also sending messages to the user like "couldn't create your page, one with that name already exists". i could implement all kinds of checks at every level of my code, but i have this intuitive feeling that some kind of message stack would be a more efficient way to do it.