1 /* ****************************************************************************
\r
3 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5 * This software is subject to the Microsoft Public License (Ms-PL).
\r
6 * A copy of the license can be found in the license.htm file included
\r
7 * in this distribution.
\r
9 * You must not remove this notice, or any other, from this software.
\r
11 * ***************************************************************************/
\r
13 namespace System.Web.Mvc {
\r
17 public class ModelError {
\r
19 public ModelError(Exception exception)
\r
20 : this(exception, null /* errorMessage */) {
\r
23 public ModelError(Exception exception, string errorMessage)
\r
24 : this(errorMessage) {
\r
25 if (exception == null) {
\r
26 throw new ArgumentNullException("exception");
\r
29 Exception = exception;
\r
32 public ModelError(string errorMessage) {
\r
33 ErrorMessage = errorMessage ?? String.Empty;
\r
36 public Exception Exception {
\r
41 public string ErrorMessage {
\r