Home / Function/ get_adjustments() — svelte Function Reference

get_adjustments() — svelte Function Reference

Architecture documentation for the get_adjustments() function in error-handling.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  f3a3e160_5beb_7c11_cb81_2668cf6cc2cd["get_adjustments()"]
  a502a1d2_db34_608a_1001_5401b198ec66["error-handling.js"]
  f3a3e160_5beb_7c11_cb81_2668cf6cc2cd -->|defined in| a502a1d2_db34_608a_1001_5401b198ec66
  6c1ccbf4_9a62_285e_f0c7_95d2b223818c["handle_error()"]
  6c1ccbf4_9a62_285e_f0c7_95d2b223818c -->|calls| f3a3e160_5beb_7c11_cb81_2668cf6cc2cd
  style f3a3e160_5beb_7c11_cb81_2668cf6cc2cd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/error-handling.js lines 76–99

function get_adjustments(error, effect) {
	const message_descriptor = get_descriptor(error, 'message');

	// if the message was already changed and it's not configurable we can't change it
	// or it will throw a different error swallowing the original error
	if (message_descriptor && !message_descriptor.configurable) return;

	var indent = is_firefox ? '  ' : '\t';
	var component_stack = `\n${indent}in ${effect.fn?.name || '<unknown>'}`;
	var context = effect.ctx;

	while (context !== null) {
		component_stack += `\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;
		context = context.p;
	}

	return {
		message: error.message + `\n${component_stack}\n`,
		stack: error.stack
			?.split('\n')
			.filter((line) => !line.includes('svelte/src/internal'))
			.join('\n')
	};
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does get_adjustments() do?
get_adjustments() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/error-handling.js.
Where is get_adjustments() defined?
get_adjustments() is defined in packages/svelte/src/internal/client/error-handling.js at line 76.
What calls get_adjustments()?
get_adjustments() is called by 1 function(s): handle_error.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free