* Web.csproj:
* App.master: * IModule.cs: * IRenderer.cs: * DataManager.cs: * ITagHandler.cs: * ViewRenderer.cs: * ResultPages.cs: * BBCodeHelper.cs: * IViewRenderer.cs: * Entity.cs: * YavscModel.csproj: * OAuth2.cs: * Calendar.cs: * Profile.aspx: * ApiClient.cs: * MapTracks.cs: * SalesCatalog.csproj: * EntityQuery.cs: * AdminController.cs: * BlogsController.cs: * GoogleController.cs: * SimpleJsonPostMethod.cs: * JsonReaderError.cs: * AccountController.cs: * JsonReaderError.aspx: * GoogleErrorMessage.cs: * GoogleErrorMessage.aspx: * Catalog.cs: refactoring * Makefile: preprod is from local domain, and prod is for lua.pschneider.fr
This commit is contained in:
parent
f86404fe85
commit
8301159645
29 changed files with 969 additions and 314 deletions
|
|
@ -19,13 +19,32 @@
|
|||
// 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
|
||||
{
|
||||
public class JsonReaderError
|
||||
public class GoogleErrorException : Exception
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public Exception Excepx { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Content { get; set; }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
public GoogleErrorException(JsonReaderException ex, string message) {
|
||||
Content = message;
|
||||
Title = ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue