File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,9 @@ export class FileService implements OnModuleInit {
167167 . take ( take )
168168 . skip ( skip )
169169 . getManyAndCount ( ) ;
170+ if ( files . length === 0 ) {
171+ throw new Error ( 'No files found.' ) ;
172+ }
170173
171174 return {
172175 data : files . map ( ( element ) => fileEntityToDto ( element ) ) ,
Original file line number Diff line number Diff line change 2222from typing import Sequence
2323from uuid import UUID
2424
25+ import httpx
2526from rich .console import Console
2627from tqdm import tqdm
2728
3334from kleinkram .api .query import MissionQuery
3435from kleinkram .api .query import ProjectQuery
3536from kleinkram .api .query import check_mission_query_is_creatable
37+ from kleinkram .errors import InvalidFileQuery
3638from kleinkram .errors import MissionNotFound
3739from kleinkram .models import FileState
3840from kleinkram .models import FileVerificationStatus
@@ -67,7 +69,12 @@ def download(
6769 raise ValueError (f"Destination { base_dir .absolute ()} is not a directory" )
6870
6971 # retrive files and get the destination paths
70- files = list (kleinkram .api .routes .get_files (client , file_query = query ))
72+ try :
73+ files = list (kleinkram .api .routes .get_files (client , file_query = query ))
74+ except httpx .HTTPStatusError :
75+ raise InvalidFileQuery (
76+ f"Files not found. Maybe you forgot to specify mission or project flags: { query } "
77+ )
7178 paths = file_paths_from_files (files , dest = base_dir , allow_nested = nested )
7279
7380 if verbose :
You can’t perform that action at this time.
0 commit comments