Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 80c23d4f authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

handle the case when a file can't be opened

parent c6214739
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ Imports System.Collections.Generic ...@@ -14,6 +14,7 @@ Imports System.Collections.Generic
Imports System.Drawing.Imaging Imports System.Drawing.Imaging
Imports System.IO Imports System.IO
Imports System.Linq Imports System.Linq
Imports System.Runtime.CompilerServices
Imports System.Text.RegularExpressions Imports System.Text.RegularExpressions
Imports System.Windows.Forms.DataVisualization.Charting Imports System.Windows.Forms.DataVisualization.Charting
Imports TUGraz.VECTO.Input_Files Imports TUGraz.VECTO.Input_Files
...@@ -370,9 +371,17 @@ Public Class VectoJobForm ...@@ -370,9 +371,17 @@ Public Class VectoJobForm
VectoNew() VectoNew()
'Read GEN 'Read GEN
Dim inputData As IEngineeringInputDataProvider = TryCast(JSONInputDataFactory.ReadComponentData(file), Dim vectoJob As IEngineeringJobInputData = Nothing
IEngineeringInputDataProvider) Dim inputData As IEngineeringInputDataProvider = Nothing
Dim vectoJob As IEngineeringJobInputData = inputData.JobInputData() Try
inputData = TryCast(JSONInputDataFactory.ReadComponentData(file),
IEngineeringInputDataProvider)
vectoJob = inputData.JobInputData()
Catch ex As Exception
MsgBox("Failed to read Job-File" + Environment.NewLine + ex.Message)
Return
End Try
If Cfg.DeclMode <> vectoJob.SavedInDeclarationMode Then If Cfg.DeclMode <> vectoJob.SavedInDeclarationMode Then
Select Case WrongMode() Select Case WrongMode()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment