Skip to content

Commit

Permalink
fix #9112, improve error message on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
timwr committed Feb 20, 2018
1 parent a01f0f3 commit 5083150
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def cmd_screenshot( *args )

data = client.ui.screenshot( quality )

if( data )
if data
::File.open( path, 'wb' ) do |fd|
fd.write( data )
end
Expand All @@ -162,6 +162,11 @@ def cmd_screenshot( *args )
print_line( "Screenshot saved to: #{path}" )

Rex::Compat.open_file( path ) if view
else
print_error("No screenshot data was returned.")
if client.platform == 'android'
print_error("On Android this command can only capture the application's own framebuffer.")
end
end

return true
Expand Down

0 comments on commit 5083150

Please sign in to comment.