ovity/octotree · error · Error
Not implemented
Error message
Not implemented
What it means
The Adapter base class defines getCssClass() as an abstract method that unconditionally throws 'Not implemented'. Octotree subclasses (e.g. GitHub adapter) must override it to return the CSS class applied to the sidebar. Throwing is a fail-fast guard: the base class is never meant to be used directly.
Source
Thrown at src/adapters/adapter.js:207
// Fallback message
default:
error = message = jqXHR.statusText;
break;
}
cb({
error: `Error: ${error}`,
message: message,
status: jqXHR.status
});
}
/**
* Returns the CSS class to be added to the Octotree sidebar.
* @api public
*/
getCssClass() {
throw new Error('Not implemented');
}
/**
* Returns the minimum width acceptable for the sidebar.
* @api protected
*/
getMinWidth() {
return 220;
}
/**
* Inits behaviors after the sidebar is added to the DOM.
* @api public
*/
init($sidebar) {
$sidebar.resizable({handles: 'e', minWidth: this.getMinWidth()});
}
View on GitHub (pinned to 470747c700)
Solutions
- Create a concrete subclass of Adapter and override getCssClass() to return a non-empty string like 'octotree-sidebar'
- If you already have a subclass, add the missing getCssClass() override
- Ensure the adapter factory/registration maps to the concrete adapter (GitHubAdapter etc.), not Adapter itself
- After an Octotree upgrade, implement any newly added abstract methods listed in adapter.js
Example fix
// before
class MyAdapter extends Adapter {}
new MyAdapter([]);
// after
class MyAdapter extends Adapter {
getCssClass() { return 'octotree-sidebar'; }
} Defensive patterns
Strategy: validation
Validate before calling
const ABSTRACT = ['getCssClass','loadCodeTree','getCreateTokenUrl','updateLayout','getRepoFromPath'];
const unimplemented = ABSTRACT.filter((m) => Adapter.prototype[m] === adapter[m]);
if (unimplemented.length) throw new Error(`Unimplemented abstract methods: ${unimplemented}`); Prevention
- Run an abstract-method conformance check in CI for every adapter
When it happens
Trigger: A developer instantiated the base Adapter class directly, or registered a custom adapter subclass that forgot to override getCssClass(), and Octotree rendered the sidebar and asked the adapter for its CSS class.
Common situations: Writing a custom Octotree adapter for a new site (e.g. GitLab/Bitbucket fork) and omitting one abstract method; upgrading Octotree where a new abstract method was added to the base Adapter and a previously working custom adapter no longer implements it; accidentally exporting/wiring the base class instead of a concrete adapter.
Understand the failure class
Background: "NotImplementedError: Subclasses should override this method" / "must be implemented" — abstract method errors explained — this error's family across 40 libraries.
AI-assisted analysis of ovity/octotree@470747c700 (2026-08-31).
Data as JSON: /api/errors/6d64191a5c7075b2.
Report an issue: GitHub.