CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
ServerException.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ServerException.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Sanitized exception for server-side data portal operations.</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Text;
11
12namespace Csla.Server
13{
19 public class ServerException : Exception
20 {
21
22 private const string IdentifierKey = "identifier";
23
28 public ServerException(string identifier) : base(Properties.Resources.SanitizedServerSideDataPortalException)
29 {
30 Data.Add(IdentifierKey, identifier);
31 }
32
37 public string RequestIdentifier
38 { get
39 {
40 return Data[IdentifierKey].ToString();
41 }
42 }
43
48 public override string ToString()
49 {
50 return string.Format(Properties.Resources.SanitizedServerSideDataPortalDetailedException, RequestIdentifier);
51 }
52 }
53}
Sanitized server-side data portal exception; used to avoid the transmission of sensitive server-side ...
override string ToString()
Override of the ToString method to insert the unique identifier
string RequestIdentifier
The unique identifier for the request that failed Use this identifier to look for the exception detai...
ServerException(string identifier)
Constructor.