| 
									
										
										
										
											2017-03-25 05:17:47 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Jarid Margolin @jaridmargolin | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-06 17:27:56 +08:00
										 |  |  | const inspect = require("util").inspect.custom; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-04 00:57:02 +08:00
										 |  |  | class WebpackError extends Error { | 
					
						
							| 
									
										
										
										
											2018-05-07 14:19:41 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * Creates an instance of WebpackError. | 
					
						
							|  |  |  | 	 * @param {string=} message error message | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-04-06 13:59:58 +08:00
										 |  |  | 	constructor(message) { | 
					
						
							|  |  |  | 		super(message); | 
					
						
							| 
									
										
										
										
											2018-04-08 08:44:27 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 00:44:28 +08:00
										 |  |  | 		this.details = undefined; | 
					
						
							| 
									
										
										
										
											2018-05-04 00:57:02 +08:00
										 |  |  | 		this.missing = undefined; | 
					
						
							|  |  |  | 		this.origin = undefined; | 
					
						
							|  |  |  | 		this.dependencies = undefined; | 
					
						
							|  |  |  | 		this.module = undefined; | 
					
						
							| 
									
										
										
										
											2018-04-12 00:44:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 13:59:58 +08:00
										 |  |  | 		Error.captureStackTrace(this, this.constructor); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-06 17:27:56 +08:00
										 |  |  | 	[inspect]() { | 
					
						
							| 
									
										
										
										
											2017-03-25 05:17:47 +08:00
										 |  |  | 		return this.stack + (this.details ? `\n${this.details}` : ""); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-05-04 00:57:02 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = WebpackError; |