Some error messages verbosity improved

main
Inga 🏳‍🌈 14 years ago
parent 5ba874b5c9
commit 18dae2e5a1
  1. 2
      Common/UploadManager.cs
  2. 2
      Common/dataobjects/Account.cs
  3. 2
      IISMainHandler/handlers/request/MigrateAccountHandler.cs

@ -46,7 +46,7 @@ namespace FLocal.Common {
string extension = filename.Split('.').Last().ToLower(); 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"); if(fileStream.Length > MAX_UPLOAD_FILESIZE) throw new FLocalException("File is too big");
byte[] data = new byte[fileStream.Length]; byte[] data = new byte[fileStream.Length];

@ -190,7 +190,7 @@ namespace FLocal.Common.dataobjects {
if(newName.Length > 16) throw new FLocalException("Name is too long"); if(newName.Length > 16) throw new FLocalException("Name is too long");
try { try {
Account.LoadByName(newName); Account.LoadByName(newName);
throw new FLocalException("Name is already used"); throw new FLocalException("Name '" + newName + "' is already used");
} catch(NotFoundInDBException) { } catch(NotFoundInDBException) {
} }
} }

@ -15,7 +15,7 @@ namespace FLocal.IISHandler.handlers.request {
protected override Account DoCreateAccount(WebContext context) { protected override Account DoCreateAccount(WebContext context) {
Account account = Account.LoadById(int.Parse(context.httprequest.Form["accountId"])); 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); string userInfo = ShallerGateway.getUserInfoAsString(account.user.name);
Regex regex = new Regex("\\(fhn\\:([a-z0-9]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); Regex regex = new Regex("\\(fhn\\:([a-z0-9]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
Match match = regex.Match(userInfo); Match match = regex.Match(userInfo);

Loading…
Cancel
Save