File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -102,12 +102,21 @@ public dynamic GetJob(string jobId)
102
102
if ( ! Guid . TryParse ( jobId , out jobGuid ) )
103
103
throw new ArgumentOutOfRangeException ( "jobId is not a valid GUID" ) ;
104
104
105
- using ( TextReader reader = new StreamReader (
106
- Path . Combine ( WebApiConfiguration . Instance . Jobs . JobStorePath , jobId + ".json" ) ) )
105
+ string jobPath = Path . Combine ( WebApiConfiguration . Instance . Jobs . JobStorePath , jobId + ".json" ) ;
106
+
107
+ if ( File . Exists ( jobPath ) )
108
+ using ( TextReader reader = new StreamReader ( jobPath ) )
109
+ {
110
+ dynamic d = JObject . Parse ( reader . ReadToEnd ( ) ) ;
111
+ return d ;
112
+ }
113
+
114
+ return new ErrorResponse
107
115
{
108
- dynamic d = JObject . Parse ( reader . ReadToEnd ( ) ) ;
109
- return d ;
110
- }
116
+ ActivityId = Guid . NewGuid ( ) ,
117
+ LogFile = String . Empty ,
118
+ Message = "Cannot find record of job completion"
119
+ } ;
111
120
}
112
121
113
122
/// <summary>
You can’t perform that action at this time.
0 commit comments