Fix crash when disk is full
This commit is contained in:
		
							parent
							
								
									9dbd819313
								
							
						
					
					
						commit
						80d963fab6
					
				| 
						 | 
				
			
			@ -14,7 +14,6 @@ const m3u8Regex* = re"""url="(.+.m3u8)""""
 | 
			
		|||
proc createMediaRouter*(cfg: Config) =
 | 
			
		||||
  router media:
 | 
			
		||||
    get "/pic/?":
 | 
			
		||||
      echo "empty pic"
 | 
			
		||||
      resp Http404
 | 
			
		||||
 | 
			
		||||
    get "/pic/@url":
 | 
			
		||||
| 
						 | 
				
			
			@ -41,6 +40,9 @@ proc createMediaRouter*(cfg: Config) =
 | 
			
		|||
          client.safeClose()
 | 
			
		||||
          removeFile(filename)
 | 
			
		||||
          resp Http404
 | 
			
		||||
        except OSError:
 | 
			
		||||
          echo "Disk full"
 | 
			
		||||
          resp Http404
 | 
			
		||||
        finally:
 | 
			
		||||
          client.safeClose()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue