added filename=None in error-case generate() response to be consistent