add error handling to module export
This commit is contained in:
		| @ -7,7 +7,7 @@ | ||||
|  | ||||
| <div class="container"> | ||||
|     <div class="row mb-1 align-items-center"> | ||||
|         <Label Class="col-sm-3" For="content" HelpText="Enter the module content" ResourceKey="Content">Content: </Label> | ||||
|         <Label Class="col-sm-3" For="content" HelpText="The Exported Module Content" ResourceKey="Content">Content: </Label> | ||||
|         <div class="col-sm-9"> | ||||
|             <textarea id="content" class="form-control" @bind="@_content" rows="5" readonly></textarea> | ||||
|         </div> | ||||
| @ -25,6 +25,15 @@ | ||||
|  | ||||
|     private async Task ExportModule() | ||||
|     { | ||||
|         _content = await ModuleService.ExportModuleAsync(ModuleState.ModuleId); | ||||
|         try | ||||
|         { | ||||
|             _content = await ModuleService.ExportModuleAsync(ModuleState.ModuleId); | ||||
|             AddModuleMessage(Localizer["Success.Content.Export"], MessageType.Success); | ||||
|         } | ||||
|         catch (Exception ex) | ||||
|         { | ||||
|             await logger.LogError(ex, "Error Exporting Module {ModuleId} {Error}", ModuleState.ModuleId, ex.Message); | ||||
|             AddModuleMessage(Localizer["Error.Module.Export"], MessageType.Error); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker