mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:02:46 +00:00 
			
		
		
		
	 4db5406d62
			
		
	
	
		4db5406d62
		
	
	
	
	
		
			
			We now allow any JS::ThrowCompletion<T>, as well as JS::Completion directly (although we'll VERIFY() that it's a throw completion.)
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			411 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			411 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, David Tuin <davidot@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibJS/Forward.h>
 | |
| 
 | |
| namespace Web::HTML {
 | |
| 
 | |
| void report_exception(JS::Completion const&);
 | |
| 
 | |
| template<typename T>
 | |
| inline void report_exception(JS::ThrowCompletionOr<T> const& result)
 | |
| {
 | |
|     VERIFY(result.is_throw_completion());
 | |
|     report_exception(result.throw_completion());
 | |
| }
 | |
| 
 | |
| }
 |