From 18dae2e5a12c6932440ffb8fba618769c1b02e06 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sun, 12 Sep 2010 13:02:56 +0000 Subject: [PATCH] Some error messages verbosity improved --- Common/UploadManager.cs | 2 +- Common/dataobjects/Account.cs | 2 +- IISMainHandler/handlers/request/MigrateAccountHandler.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/UploadManager.cs b/Common/UploadManager.cs index 99f238b..03e7f15 100644 --- a/Common/UploadManager.cs +++ b/Common/UploadManager.cs @@ -46,7 +46,7 @@ namespace FLocal.Common { string extension = filename.Split('.').Last().ToLower(); - if(!allowedExtensions.Contains(extension)) throw new FLocalException("Unsupported extension"); + if(!allowedExtensions.Contains(extension)) throw new FLocalException("Unsupported extension '" + extension + "'"); if(fileStream.Length > MAX_UPLOAD_FILESIZE) throw new FLocalException("File is too big"); byte[] data = new byte[fileStream.Length]; diff --git a/Common/dataobjects/Account.cs b/Common/dataobjects/Account.cs index 196b590..ef51d03 100644 --- a/Common/dataobjects/Account.cs +++ b/Common/dataobjects/Account.cs @@ -190,7 +190,7 @@ namespace FLocal.Common.dataobjects { if(newName.Length > 16) throw new FLocalException("Name is too long"); try { Account.LoadByName(newName); - throw new FLocalException("Name is already used"); + throw new FLocalException("Name '" + newName + "' is already used"); } catch(NotFoundInDBException) { } } diff --git a/IISMainHandler/handlers/request/MigrateAccountHandler.cs b/IISMainHandler/handlers/request/MigrateAccountHandler.cs index 6d16fe9..5be5a1c 100644 --- a/IISMainHandler/handlers/request/MigrateAccountHandler.cs +++ b/IISMainHandler/handlers/request/MigrateAccountHandler.cs @@ -15,7 +15,7 @@ namespace FLocal.IISHandler.handlers.request { protected override Account DoCreateAccount(WebContext context) { Account account = Account.LoadById(int.Parse(context.httprequest.Form["accountId"])); - if(!account.needsMigration) throw new FLocalException("Already migrated"); + if(!account.needsMigration) throw new FLocalException("Account '" + account.name + "' is already migrated"); string userInfo = ShallerGateway.getUserInfoAsString(account.user.name); Regex regex = new Regex("\\(fhn\\:([a-z0-9]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); Match match = regex.Match(userInfo);