Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:50:31+00:00 2026-05-26T09:50:31+00:00

Usually a PHP application has an user interface. In a MVC layered application you

  • 0

Usually a PHP application has an user interface. In a MVC layered application you might throw some exceptions.

What type of message do you set in the exception:

A)

  • a custom message to display to the user
  • and you log the error with technical details before throwing it

B)

  • a custom technical error and a custom exception
  • no logging near the exception
  • catch the exception, log the error and display a custom user message based on exception type

C) other variants

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:50:31+00:00Added an answer on May 26, 2026 at 9:50 am

    General Practice

    C – You should only record backtrace when error happens, because you won’t be able to recover it. You catch error message inside your Application class and then depending on the setting either display message or log it and display some sort of generic screen to the user.

    When logging error, add more information such as browser version, ip address, URL requested.

    User-friendly messages

    Inside my Models I sometimes throw “ForUser” type exceptions. Those don’t record backtrace and when caught by the Application class they are displayed to the user. There are few exception sub-classes to that such as Validation, Logic etc.

    Re-Throwing exceptions

    Some UI elements detect exceptions to properly display them, such as form submission would call Model->update(), catches validation exceptions and shows them for appropriate field inside my Ajax form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've set up a new database config in application/config/database.php called staff . I've then
I am currently building an MVC application in PHP (not using any frameworks). I
I am trying to code an simple PHP application which will retrieve some information
I am currently building an application in PHP using CodeIgniter. Usually, in .NET applications,
I've recently come on board with a PHP application. There has not been much
I have a page called Error.php. Variables are usually passed to it using the
hello frieds this is how i usually post a variable using Jquery.. $.post(include/save_legatee.inc.php, {
i just create reading file feature. In general, what kind PHP class that usually
The time has come for me to understand MVC, so that's what I'm trying
I'm building a PHP/MySQL application and I'm running into a problem with my create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.