* Profile.aspx: * MyProfile.aspx: * AccountController.cs: renamed the Profile method to "MyProfile", could avoid issue at migrating to MVC5 * favicon.png: favicon now displays a ~"Yavsc" * BlogManager.cs: * BlogsApiController.cs: The authorisation for removing a post is now implemented at Manager's side * BlogsController.cs: Removes this odd call to a static method from the Api controller * CalendarApi.cs: * GoogleController.cs: no more json output for the calls to the Google Api * WorkFlowController.cs: sorted using clauses * Basket.cs: * Commande.cs: * EstimToPdfFormatter.cs: * Brand.cs: adds xml doc * RssFeedsFormatter.cs: modifies xml doc * TexToPdfFormatter.cs: refactoring * Global.asax.cs: Document formatting * BBCodeHelper.cs: encapsulates the url display from the BBCode in starting and closing characters : "<>" * OAuth2.cs: * SimpleJsonPostMethod.cs: using System.Runtime.Serialization.Json instead of Newtonsof.Json * App.master: updating the favicon * RegistrationPending.aspx: fixes the returnUrl usage * AssemblyInfo.aspx: better explanation for this list * Web.config: tried to migrate to MVC5 (using NuGets) * Estim.cs: * ChangePasswordModel.cs: adds xmldoc * BasketController.cs: * BlogProvidersConfigurationSection.cs: cosmetic change * GoogleErrorMessage.cs: - adds xml docs - renders ctor from JsonReaderException obsolete * MvcActionValueBinder.cs: not used * web.config: no more used, gave it up to migrate to MVC5
79 lines
2.3 KiB
C#
79 lines
2.3 KiB
C#
//
|
|
// JsonReaderError.cs
|
|
//
|
|
// Author:
|
|
// Paul Schneider <paulschneider@free.fr>
|
|
//
|
|
// Copyright (c) 2015 Paul Schneider
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
using System;
|
|
using System.Net;
|
|
using System.IO;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Yavsc.Model.Google
|
|
{
|
|
/// <summary>
|
|
/// Google error exception.
|
|
/// </summary>
|
|
public class GoogleErrorException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the title.
|
|
/// </summary>
|
|
/// <value>The title.</value>
|
|
public string Title { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the content.
|
|
/// </summary>
|
|
/// <value>The content.</value>
|
|
public string Content { get; set; }
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
|
|
/// </summary>
|
|
/// <param name="ex">Ex.</param>
|
|
public GoogleErrorException (WebException ex) {
|
|
// ASSERT ex != null;
|
|
Title = ex.Message;
|
|
|
|
using (var stream = ex.Response.GetResponseStream())
|
|
using (var reader = new StreamReader(stream))
|
|
{
|
|
Content = reader.ReadToEnd();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
|
|
/// </summary>
|
|
/// <param name="ex">Ex.</param>
|
|
/// <param name="message">Message.</param>
|
|
[Obsolete]
|
|
public GoogleErrorException(Exception ex, string message) {
|
|
Content = message;
|
|
Title = ex.Message;
|
|
}
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
|
|
/// </summary>
|
|
/// <param name="ex">Ex.</param>
|
|
[Obsolete]
|
|
public GoogleErrorException(Exception ex) {
|
|
Content = ex.Message;
|
|
Title = ex.GetType().FullName;
|
|
}
|
|
}
|
|
|
|
}
|
|
|