Jump to content
php.lv forumi

error rādīšana


renathy

Recommended Posts

Kā Jūs principiāli mēdzat apstrādāt kļūdu paziņojumus?

 

Piemēram, funkcija user_exists atdod true/false attiecīgi, bet kā apstrādāt teiksim, ja iekš user_exists neizdodas pieslēgties db, vai lietot die vai kā citādi?

 

Kāda ir prakse, varbūt kādi raksti?

Link to comment
Share on other sites

Ja kaut kas kritisks, bez kaa lapa nevar darboties, tad parasti ir funkcija, piem, do_fatal(), kas publiskai lapai paraadiis kaadu maintenance, vai error lapu, bet development lapai paraadiis kljuudu, backtrace, utt...

 

Ja kaut kas ne-kritisks no kaa var atguuties, tad vai nu exception's vai return false vai kaut kas taads un tad jau izsaucoshaa f-ja domaa ko dariit ar to taalaak.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...