diff --git a/build-agda-html.rb b/build-agda-html.rb
index ccdb1d3..c271988 100644
--- a/build-agda-html.rb
+++ b/build-agda-html.rb
@@ -32,5 +32,6 @@ files_for_paths.each do |path, files|
files.each do |file|
puts "Invoking 'agda' on file: #{File.join [Dir.getwd, file]}"
`#{ARGV[0]} --local-interfaces #{file} --html --html-dir=html`
+ fail unless $? == 0
end
end